diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2013-06-18 06:29:49 -0400 |
---|---|---|
committer | Simon Horman <horms+renesas@verge.net.au> | 2013-06-19 08:38:38 -0400 |
commit | e305062e94719ef543ae936dd56501b5a36406c6 (patch) | |
tree | dc6bcb323371eea302f54db478e1d8b34c2b5fa3 /drivers/gpio | |
parent | b559c3e8e7ca469921987925baf892ab2038396e (diff) |
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>
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/gpio-rcar.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/gpio/gpio-rcar.c b/drivers/gpio/gpio-rcar.c index 5a693dd0ac7a..7fd09efd708f 100644 --- a/drivers/gpio/gpio-rcar.c +++ b/drivers/gpio/gpio-rcar.c | |||
@@ -279,16 +279,13 @@ static struct irq_domain_ops gpio_rcar_irq_domain_ops = { | |||
279 | static void gpio_rcar_parse_pdata(struct gpio_rcar_priv *p) | 279 | static void gpio_rcar_parse_pdata(struct gpio_rcar_priv *p) |
280 | { | 280 | { |
281 | struct gpio_rcar_config *pdata = p->pdev->dev.platform_data; | 281 | struct gpio_rcar_config *pdata = p->pdev->dev.platform_data; |
282 | #ifdef CONFIG_OF | ||
283 | struct device_node *np = p->pdev->dev.of_node; | 282 | struct device_node *np = p->pdev->dev.of_node; |
284 | struct of_phandle_args args; | 283 | struct of_phandle_args args; |
285 | int ret; | 284 | int ret; |
286 | #endif | ||
287 | 285 | ||
288 | if (pdata) | 286 | if (pdata) { |
289 | p->config = *pdata; | 287 | p->config = *pdata; |
290 | #ifdef CONFIG_OF | 288 | } else if (IS_ENABLED(CONFIG_OF) && np) { |
291 | else if (np) { | ||
292 | ret = of_parse_phandle_with_args(np, "gpio-ranges", | 289 | ret = of_parse_phandle_with_args(np, "gpio-ranges", |
293 | "#gpio-range-cells", 0, &args); | 290 | "#gpio-range-cells", 0, &args); |
294 | p->config.number_of_pins = ret == 0 && args.args_count == 3 | 291 | p->config.number_of_pins = ret == 0 && args.args_count == 3 |
@@ -296,7 +293,6 @@ static void gpio_rcar_parse_pdata(struct gpio_rcar_priv *p) | |||
296 | : RCAR_MAX_GPIO_PER_BANK; | 293 | : RCAR_MAX_GPIO_PER_BANK; |
297 | p->config.gpio_base = -1; | 294 | p->config.gpio_base = -1; |
298 | } | 295 | } |
299 | #endif | ||
300 | 296 | ||
301 | if (p->config.number_of_pins == 0 || | 297 | if (p->config.number_of_pins == 0 || |
302 | p->config.number_of_pins > RCAR_MAX_GPIO_PER_BANK) { | 298 | p->config.number_of_pins > RCAR_MAX_GPIO_PER_BANK) { |