diff mbox

[v2,2/2] gpio-rcar: Remove #ifdef CONFIG_OF around OF-specific sections

Message ID 1371551389-5493-3-git-send-email-laurent.pinchart+renesas@ideasonboard.com (mailing list archive)
State New, archived
Headers show

Commit Message

Laurent Pinchart June 18, 2013, 10:29 a.m. UTC
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>
---
 drivers/gpio/gpio-rcar.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

Comments

Linus Walleij June 19, 2013, 7:17 p.m. UTC | #1
On Tue, Jun 18, 2013 at 12:29 PM, Laurent Pinchart
<laurent.pinchart+renesas@ideasonboard.com> wrote:

> 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>

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij
Laurent Pinchart June 19, 2013, 7:51 p.m. UTC | #2
Hi Linus,

On Wednesday 19 June 2013 21:17:35 Linus Walleij wrote:
> On Tue, Jun 18, 2013 at 12:29 PM, Laurent Pinchart wrote:
> > 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>
> 
> Acked-by: Linus Walleij <linus.walleij@linaro.org>

Thank you. Can you please take the patch in your tree ?
Linus Walleij June 20, 2013, 6:42 a.m. UTC | #3
On Wed, Jun 19, 2013 at 9:51 PM, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
> On Wednesday 19 June 2013 21:17:35 Linus Walleij wrote:
>> On Tue, Jun 18, 2013 at 12:29 PM, Laurent Pinchart wrote:
>> > 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>
>>
>> Acked-by: Linus Walleij <linus.walleij@linaro.org>
>
> Thank you. Can you please take the patch in your tree ?

No. It does not apply:

]$ git am --signoff rcar-fix.patch
Tillämpar: gpio-rcar: Remove #ifdef CONFIG_OF around OF-specific sections
error: patch misslyckades: drivers/gpio/gpio-rcar.c:279
error: drivers/gpio/gpio-rcar.c: patchen kan inte tillämpas
Patchen misslyckades vid 0001 gpio-rcar: Remove #ifdef CONFIG_OF
around OF-specific sections
En kopia av patchen som misslyckades finns i:
   /home/linus/src/linux-trees/linux-gpio/.git/rebase-apply/patch
När du har löst problemet kör du "git am --resolved".
Om du vill hoppa över patchen kör du istället "git am --skip".
För att återställa originalgrenen och avbryta kör du "git am --abort".


Isn't this RCAR stuff funneled through ARM SoC this merge window?
Then you have to send it to the ARM SoC folks corresponding branch.

Yours,
Linus Walleij
Laurent Pinchart June 20, 2013, 8:04 a.m. UTC | #4
Hi Linus,

On Thursday 20 June 2013 08:42:23 Linus Walleij wrote:
> On Wed, Jun 19, 2013 at 9:51 PM, Laurent Pinchart wrote:
> > On Wednesday 19 June 2013 21:17:35 Linus Walleij wrote:
> >> On Tue, Jun 18, 2013 at 12:29 PM, Laurent Pinchart wrote:
> >> > 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>
> >> 
> >> Acked-by: Linus Walleij <linus.walleij@linaro.org>
> > 
> > Thank you. Can you please take the patch in your tree ?
> 
> No. It does not apply:
> 
> ]$ git am --signoff rcar-fix.patch
> Tillämpar: gpio-rcar: Remove #ifdef CONFIG_OF around OF-specific sections
> error: patch misslyckades: drivers/gpio/gpio-rcar.c:279
> error: drivers/gpio/gpio-rcar.c: patchen kan inte tillämpas
> Patchen misslyckades vid 0001 gpio-rcar: Remove #ifdef CONFIG_OF
> around OF-specific sections
> En kopia av patchen som misslyckades finns i:
>    /home/linus/src/linux-trees/linux-gpio/.git/rebase-apply/patch
> När du har löst problemet kör du "git am --resolved".
> Om du vill hoppa över patchen kör du istället "git am --skip".
> För att återställa originalgrenen och avbryta kör du "git am --abort".
> 
> 
> Isn't this RCAR stuff funneled through ARM SoC this merge window?
> Then you have to send it to the ARM SoC folks corresponding branch.

Oops, my bad. I had mistaken it for one of the pinctrl patches.

/me needs to sleep more :-)
diff mbox

Patch

diff --git a/drivers/gpio/gpio-rcar.c b/drivers/gpio/gpio-rcar.c
index 5a693dd..7fd09ef 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 = {
 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
@@ -296,7 +293,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) {