Patchwork [v4,01/14] mtd: nand: pxa3xx: Remove unneeded ifdef CONFIG_OF

login
register
mail settings
Submitter Ezequiel Garcia
Date Aug. 12, 2013, 5:14 p.m.
Message ID <1376327699-7973-2-git-send-email-ezequiel.garcia@free-electrons.com>
Download mbox | patch
Permalink /patch/266579/
State New
Headers show

Comments

Ezequiel Garcia - Aug. 12, 2013, 5:14 p.m.
There's no need to enclose this code within idef CONFIG_OF,
because the OF framework provides no-op stubs if CONFIG_OF=n.

Cc: devicetree@vger.kernel.org
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
---
 drivers/mtd/nand/pxa3xx_nand.c | 7 -------
 1 file changed, 7 deletions(-)
David Woodhouse - Aug. 30, 2013, 8:06 p.m.
On Mon, 2013-08-12 at 14:14 -0300, Ezequiel Garcia wrote:
> There's no need to enclose this code within idef CONFIG_OF,
> because the OF framework provides no-op stubs if CONFIG_OF=n.

Hm, won't this end up with the same 'pxa3xx_nand_dt_ids is defined but
not used' warning that just caused us to *add* an #ifdef CONFIG_OF to
atmel_nand?
Ezequiel Garcia - Aug. 31, 2013, 4:53 p.m.
On Fri, Aug 30, 2013 at 09:06:22PM +0100, David Woodhouse wrote:
> On Mon, 2013-08-12 at 14:14 -0300, Ezequiel Garcia wrote:
> > There's no need to enclose this code within idef CONFIG_OF,
> > because the OF framework provides no-op stubs if CONFIG_OF=n.
> 
> Hm, won't this end up with the same 'pxa3xx_nand_dt_ids is defined but
> not used' warning that just caused us to *add* an #ifdef CONFIG_OF to
> atmel_nand? 
> 

No, it won't.

Currently atmel_nand uses its of_device_id for just the of_match_table,
while pxa3xx-nand uses the pxa3xx_nand_dt_ids for more than just that,
as a paramater for of_match_device().

The latter prevents the warning by having an actual dummy-inlined
implementation for the !OF case.

I'll answer about the atmel_nand in the respective patch.
Olof Johansson - Sept. 16, 2013, 10:57 p.m.
On Mon, Aug 12, 2013 at 10:14 AM, Ezequiel Garcia
<ezequiel.garcia@free-electrons.com> wrote:
> There's no need to enclose this code within idef CONFIG_OF,
> because the OF framework provides no-op stubs if CONFIG_OF=n.
>
> Cc: devicetree@vger.kernel.org
> Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>

I've applied this to arm-soc fixes (with Brian's signed-off inbetween,
since I picked it up from linux-next by cherry-pick). Based on other
discussions, David is MIA and this patch is needed to fix pxa3xx
builds.


-Olof

Patch

diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c
index 501e380..02f214d 100644
--- a/drivers/mtd/nand/pxa3xx_nand.c
+++ b/drivers/mtd/nand/pxa3xx_nand.c
@@ -1190,7 +1190,6 @@  static int pxa3xx_nand_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_OF
 static struct of_device_id pxa3xx_nand_dt_ids[] = {
 	{ .compatible = "marvell,pxa3xx-nand" },
 	{}
@@ -1221,12 +1220,6 @@  static int pxa3xx_nand_probe_dt(struct platform_device *pdev)
 
 	return 0;
 }
-#else
-static inline int pxa3xx_nand_probe_dt(struct platform_device *pdev)
-{
-	return 0;
-}
-#endif
 
 static int pxa3xx_nand_probe(struct platform_device *pdev)
 {