blob: 951406668f3b768642b4aaf7d717556a51de5c9a [file] [log] [blame]
From 6123ad86b5be74f26d9a0afc51327721913a32f9 Mon Sep 17 00:00:00 2001
From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Date: Tue, 18 Jun 2013 12:29:49 +0200
Subject: gpio-rcar: Remove #ifdef CONFIG_OF around OF-specific sections
All functions and data types used by OF-specific code paths are declared
in <linux/of.h> regardless of CONFIG_OF. Replace the #ifdef CONFIG_OF
guard with a if(IS_ENABLED(CONFIG_OF)) and let the compiler optimize
the unused code away.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit e305062e94719ef543ae936dd56501b5a36406c6)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
drivers/gpio/gpio-rcar.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/gpio/gpio-rcar.c b/drivers/gpio/gpio-rcar.c
index d591ea64..34f86b26 100644
--- a/drivers/gpio/gpio-rcar.c
+++ b/drivers/gpio/gpio-rcar.c
@@ -286,16 +286,13 @@ static struct irq_domain_ops gpio_rcar_irq_domain_ops = {
static void gpio_rcar_parse_pdata(struct gpio_rcar_priv *p)
{
struct gpio_rcar_config *pdata = p->pdev->dev.platform_data;
-#ifdef CONFIG_OF
struct device_node *np = p->pdev->dev.of_node;
struct of_phandle_args args;
int ret;
-#endif
- if (pdata)
+ if (pdata) {
p->config = *pdata;
-#ifdef CONFIG_OF
- else if (np) {
+ } else if (IS_ENABLED(CONFIG_OF) && np) {
ret = of_parse_phandle_with_args(np, "gpio-ranges",
"#gpio-range-cells", 0, &args);
p->config.number_of_pins = ret == 0 && args.args_count == 3
@@ -303,7 +300,6 @@ static void gpio_rcar_parse_pdata(struct gpio_rcar_priv *p)
: RCAR_MAX_GPIO_PER_BANK;
p->config.gpio_base = -1;
}
-#endif
if (p->config.number_of_pins == 0 ||
p->config.number_of_pins > RCAR_MAX_GPIO_PER_BANK) {
--
1.8.4.3.gca3854a