ARM: OMAP: fix compilation problems with v3.3-rc1
Subsystems (7)
Paul Walmsley
maintainercover ARM: OMAP: fix compilation problems with v3.3-rc1
Fix several compilation problems detected with a 2420-only kernel configuration. This series is intended for the v3.3-rc merge window.
These patches are available via git at git://git.pwsan.com/linux-2.6 in the branch "omap2420_compilation_fixes_3.3rc"
- Paul
---
Paul Walmsley (3):
ARM: OMAP: PRM: fix missing plat/irqs.h build breakage
ARM: OMAP2+: io: fix compilation breakage on 2420-only configs
ARM: OMAP: I2C: fix compilation when !CONFIG_OF
arch/arm/mach-omap2/io.c | 4 +++- arch/arm/mach-omap2/prm2xxx_3xxx.c | 1 + drivers/i2c/busses/i2c-omap.c | 4 +++- 3 files changed, 7 insertions(+), 2 deletions(-)
Paul Walmsley
maintainerPATCH 1/3 ARM: OMAP: PRM: fix missing plat/irqs.h build breakage
Commit 22f51371f8c35869ed850f46aa76b6cc2b502110 ("ARM: OMAP3: pm: use prcm chain handler") breaks the build on a 2420-only config, due to a missing include for plat/irqs.h:
CC arch/arm/mach-omap2/prm2xxx_3xxx.oarch/arm/mach-omap2/prm2xxx_3xxx.c:41:11: error: 'INT_34XX_PRCM_MPU_IRQ' undeclared here (not in a function)
Fix by explicitly including it.
--- arch/arm/mach-omap2/prm2xxx_3xxx.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/prm2xxx_3xxx.c +1 -0
@@ -19,6 +19,7 @@#include "common.h" #include <plat/cpu.h> #include <plat/prcm.h> +#include <plat/irqs.h> #include "vp.h"
Paul Walmsley
maintainerPATCH 2/3 ARM: OMAP2+: io: fix compilation breakage on 2420-only configs
In reply to Paul WalmsleyCommit 7b250aff1ce346b6c7bc0329a2350334d1c66525 ("ARM: OMAP: Avoid cpu_is_omapxxxx usage until map_io is done") breaks the build on a 2420-only config on v3.3-rc1:
arch/arm/mach-omap2/built-in.o: In function `omap2430_init_early':arch/arm/mach-omap2/io.c:406: undefined reference to omap2_set_globals_243x' arch/arm/mach-omap2/io.c:410: undefined reference to omap243x_clockdomains_init' arch/arm/mach-omap2/io.c:411: undefined reference to `omap2430_hwmod_init'
Fix by only compiling omap2420_init_early() when CONFIG_SOC_OMAP2420 is selected, and only compiling omap2430_init_early() when CONFIG_SOC_OMAP2430 is selected.
--- arch/arm/mach-omap2/io.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/io.c +3 -1
@@ -388,7 +388,7 @@ static void __init omap_hwmod_init_postsetup(void)omap_pm_if_early_init (); } -#ifdef CONFIG_ARCH_OMAP2 +#ifdef CONFIG_SOC_OMAP2420 void __init omap2420_init_early (void ) {omap2_set_globals_242x ();
@@ -400,7 +400,9 @@ void __init omap2420_init_early(void)omap_hwmod_init_postsetup ();omap2420_clk_init (); } +#endif +#ifdef CONFIG_SOC_OMAP2430 void __init omap2430_init_early (void ) {omap2_set_globals_243x ();
Paul Walmsley
maintainerPATCH 3/3 ARM: OMAP: I2C: fix compilation when !CONFIG_OF
In reply to Paul WalmsleyCommit 6145197be6cc0583fa1a2f4ec1079d366137061e ("i2c: OMAP: Add DT support for i2c controller") breaks compilation when CONFIG_OF is not defined:
CC drivers/i2c/busses/i2c-omap.odrivers/i2c/busses/i2c-omap.c: In function 'omap_i2c_probe':drivers/i2c/busses/i2c-omap.c:1021:26: error: 'omap_i2c_of_match' undeclared (first use in this function) drivers/i2c/busses/i2c-omap.c:1021:26: note: each undeclared identifier is reported only once for each function it appears in
Fix this by avoiding of_*() functions when !CONFIG_OF.
--- drivers/i2c/busses/i2c-omap.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/i2c/busses/i2c-omap.c +3 -1
@@ -989,7 +989,7 @@ omap_i2c_probe(struct platform_device *pdev)struct resource *mem, *irq, *ioarea;struct omap_i2c_bus_platform_data *pdata = pdev->dev.platform_data;struct device_node *node = pdev->dev.of_node; -const struct of_device_id *match; +const struct of_device_id *match =NULL ;irq_handler_t isr;int r;
@@ -1018,7 +1018,9 @@ omap_i2c_probe(struct platform_device *pdev) goto err_release_region; } +#ifdef CONFIG_OF match =of_match_device (omap_i2c_of_match, &pdev->dev); +#endif if (match) {u32 freq =100000 ;/* default to 100000 Hz */
PATCH 3/3 ARM: OMAP: I2C: fix compilation when !CONFIG_OF
Quoted 35 lines · Paul Walmsley
Commit
6145197be6cc0583fa1a2f4ec1079d366137061e("i2c: OMAP: Add DT support for i2c controller") breaks compilation whenCONFIG_OFis not defined:CC
drivers/i2c/busses/i2c-omap.odrivers/i2c/busses/i2c-omap.c: In function 'omap_i2c_probe':drivers/i2c/busses/i2c-omap.c:1021:26: error: 'omap_i2c_of_match' undeclared (first use in this function)drivers/i2c/busses/i2c-omap.c:1021:26: note: each undeclared identifier is reported only once for each function it appears inFix this by avoiding of_*() functions when !CONFIG_OF.
Signed-off-by Paul Walmsley <[email protected]>Cc Benoit Cousson <[email protected]>Cc Rob Herring <[email protected]>Cc Grant Likely <[email protected]>Cc Kevin Hilman <[email protected]>Cc Tony Lindgren <[email protected]>--- drivers/i2c/busses/i2c-omap.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)drivers/i2c/busses/i2c-omap.c +1
-1@@ -989,7 +989,7 @@ omap_i2c_probe(struct platform_device *pdev)struct resource *mem, *irq, *ioarea;struct omap_i2c_bus_platform_data *pdata = pdev->dev.platform_data;struct device_node *node = pdev->dev.of_node; -const struct of_device_id *match; +const struct of_device_id *match =NULL ;irq_handler_t isr;int r;
drivers/i2c/busses/i2c-omap.c omap_i2c_probe(struct platform_device *pdev) · line 1023
Quoted 6 lines
drivers/i2c/busses/i2c-omap.c +2
-0@@ -1018,7 +1018,9 @@ omap_i2c_probe(struct platform_device *pdev) goto err_release_region; } +#ifdef CONFIG_OF match =of_match_device (omap_i2c_of_match, &pdev->dev); +#endif
How about an empty function for of_match_device instead to avoid the ifdef.
Rob
Quoted 10 lines
drivers/i2c/busses/i2c-omap.c +0
-0if (match) {u32 freq =100000 ;/* default to 100000 Hz */ _______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 3/3 ARM: OMAP: I2C: fix compilation when !CONFIG_OF
Quoted 39 lines · Rob Herring
Quoted 38 lines · Paul Walmsley
Commit
6145197be6cc0583fa1a2f4ec1079d366137061e("i2c: OMAP: Add DT support for i2c controller") breaks compilation whenCONFIG_OFis not defined:? CC ? ? ?drivers/i2c/busses/i2c-omap.o
drivers/i2c/busses/i2c-omap.c: In function 'omap_i2c_probe':drivers/i2c/busses/i2c-omap.c:1021:26: error: 'omap_i2c_of_match' undeclared (first use in this function)drivers/i2c/busses/i2c-omap.c:1021:26: note: each undeclared identifier is reported only once for each function it appears inFix this by avoiding of_*() functions when !CONFIG_OF.
Signed-off-by Paul Walmsley <[email protected]>Cc Benoit Cousson <[email protected]>Cc Rob Herring <[email protected]>Cc Grant Likely <[email protected]>Cc Kevin Hilman <[email protected]>Cc Tony Lindgren <[email protected]>---
?drivers/i2c/busses/i2c-omap.c | ? ?4 +++-
?1 files changed, 3 insertions(+), 1 deletions(-)drivers/i2c/busses/i2c-omap.c +1
-1@@ -989,7 +989,7 @@ omap_i2c_probe(struct platform_device *pdev) ? ? ? struct resource ? ? ? ? *mem, *irq, *ioarea; ? ? ? struct omap_i2c_bus_platform_data *pdata = pdev->dev.platform_data; ? ? ? struct device_node ? ? ?*node = pdev->dev.of_node; - ? ? const struct of_device_id *match; + ? ? const struct of_device_id *match = NULL; ? ? ? irq_handler_t isr; ? ? ? int r;@@ -1018,7 +1018,9 @@ omap_i2c_probe(struct platform_device *pdev) ? ? ? ? ? ? ? goto err_release_region; ? ? ? }
Quoted 5 lines
drivers/i2c/busses/i2c-omap.c omap_i2c_probe(struct platform_device *pdev) · line 1023
Quoted 3 lines
drivers/i2c/busses/i2c-omap.c +2
-0+#ifdef CONFIG_OF ? ? ? match = of_match_device(omap_i2c_of_match, &pdev->dev); +#endif How about an empty function for
of_match_deviceinstead to avoid the ifdef.
That already exists. The problem is the undefined omap_i2c_of_match table reference.
g.
Signature · 2 lines
Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd.
PATCH 3/3 ARM: OMAP: I2C: fix compilation when !CONFIG_OF
In reply to Paul WalmsleyQuoted 10 lines · Paul Walmsley
Commit
6145197be6cc0583fa1a2f4ec1079d366137061e("i2c: OMAP: Add DT support for i2c controller") breaks compilation whenCONFIG_OFis not defined:CC
drivers/i2c/busses/i2c-omap.odrivers/i2c/busses/i2c-omap.c: In function 'omap_i2c_probe':drivers/i2c/busses/i2c-omap.c:1021:26: error: 'omap_i2c_of_match' undeclared (first use in this function)drivers/i2c/busses/i2c-omap.c:1021:26: note: each undeclared identifier is reported only once for each function it appears inFix this by avoiding of_*() functions when !CONFIG_OF.
To avoid #ifdef blocks, how about one of these fixes instead? of_match_device resolves to a static inline NULL when CONFIG_OF is not selected.
g.
---
drivers/i2c/busses/i2c-omap.c +2 -0
@@ -979,6 +979,8 @@ static const struct of_device_id omap_i2c_of_match[] = { { }, };MODULE_DEVICE_TABLE (of, omap_i2c_of_match); +#else +#define omap_i2c_of_match NULL#endif static int __devinit
Or alternately:
---
drivers/i2c/busses/i2c-omap.c +1 -1
@@ -1018,7 +1018,7 @@ omap_i2c_probe(struct platform_device *pdev) goto err_release_region; } - match =of_match_device (omap_i2c_of_match, &pdev->dev); + match =of_match_device (of_match_ptr (omap_i2c_of_match), &pdev->dev);if (match) {u32 freq =100000 ;/* default to 100000 Hz */
PATCH 3/3 ARM: OMAP: I2C: fix compilation when !CONFIG_OF
Quoted 24 lines · Grant Likely
Quoted 10 lines · Paul Walmsley
Commit
6145197be6cc0583fa1a2f4ec1079d366137061e("i2c: OMAP: Add DT support for i2c controller") breaks compilation whenCONFIG_OFis not defined:CC
drivers/i2c/busses/i2c-omap.odrivers/i2c/busses/i2c-omap.c: In function 'omap_i2c_probe':drivers/i2c/busses/i2c-omap.c:1021:26: error: 'omap_i2c_of_match' undeclared (first use in this function)drivers/i2c/busses/i2c-omap.c:1021:26: note: each undeclared identifier is reported only once for each function it appears inFix this by avoiding of_*() functions when !CONFIG_OF.
To avoid #ifdef blocks, how about one of these fixes instead?
of_match_deviceresolves to a static inline NULL whenCONFIG_OFis not selected.g.
---
drivers/i2c/busses/i2c-omap.c +0
-0
drivers/i2c/busses/i2c-omap.c static const struct of_device_id omap_i2c_of_match[] = { · line 984
Quoted 6 lines
drivers/i2c/busses/i2c-omap.c +2
-0@@ -979,6 +979,8 @@ static const struct of_device_id omap_i2c_of_match[] = { { }, };MODULE_DEVICE_TABLE (of, omap_i2c_of_match); +#else +#define omap_i2c_of_match NULL#endif
Or just remove the existing ifdef. Isn't OMAP going to be completely converted to DT?
I think building CONFIG_OF and !CONFIG_OF and running non-DT machines with OF enabled is going to be a constant source of breakage. We should move selecting CONFIG_OF up from boards/SOC config to family config (i.e. all OMAP).
Rob
PATCH 3/3 ARM: OMAP: I2C: fix compilation when !CONFIG_OF
Quoted 35 lines · Rob Herring
Quoted 24 lines · Grant Likely
Quoted 10 lines · Paul Walmsley
Commit
6145197be6cc0583fa1a2f4ec1079d366137061e("i2c: OMAP: Add DT support for i2c controller") breaks compilation whenCONFIG_OFis not defined:CC
drivers/i2c/busses/i2c-omap.odrivers/i2c/busses/i2c-omap.c: In function 'omap_i2c_probe':drivers/i2c/busses/i2c-omap.c:1021:26: error: 'omap_i2c_of_match' undeclared (first use in this function)drivers/i2c/busses/i2c-omap.c:1021:26: note: each undeclared identifier is reported only once for each function it appears inFix this by avoiding of_*() functions when !CONFIG_OF.
To avoid #ifdef blocks, how about one of these fixes instead?
of_match_deviceresolves to a static inline NULL whenCONFIG_OFis not selected.g.
---
drivers/i2c/busses/i2c-omap.c +0
-0drivers/i2c/busses/i2c-omap.c static const struct of_device_id omap_i2c_of_match[] = { · line 984
Quoted 6 lines
drivers/i2c/busses/i2c-omap.c +2
-0@@ -979,6 +979,8 @@ static const struct of_device_id omap_i2c_of_match[] = { { }, };MODULE_DEVICE_TABLE (of, omap_i2c_of_match); +#else +#define omap_i2c_of_match NULL#endif Or just remove the existing ifdef. Isn't OMAP going to be completely converted to DT?
Quoted 4 lines
I think building
CONFIG_OFand !CONFIG_OF and running non-DT machines with OF enabled is going to be a constant source of breakage. We should move selectingCONFIG_OFup from boards/SOC config to family config (i.e. all OMAP).
Yep, I do agree, and even sent a patch for that.
http://lists.ozlabs.org/pipermail/devicetree-discuss/2011-December/010541.html
But it looks like it was stuck in linux-omap dt branch and not pulled for 3.3. Maybe Tony can try to sent it during -rc phase.
That being said, this will be valid for OMAP2+ only and will still break OMAP1 platform :-(
Tony reported that 2 days ago, and I sent the fix for it.
http://www.mail-archive.com/linux-omap at vger.kernel.org/msg61520.html
It is now waiting for Ben's Acked-by.
Regards,
Benoit
Paul Walmsley
maintainerPATCH 3/3 ARM: OMAP: I2C: fix compilation when !CONFIG_OF
cc Ben, Jean
Quoted 10 lines · Benoit
http://lists.ozlabs.org/pipermail/devicetree-discuss/2011-December/010541.html
But it looks like it was stuck in linux-omap dt branch and not pulled for 3.3. Maybe Tony can try to sent it during -rc phase.
That being said, this will be valid for OMAP2+ only and will still break OMAP1 platform :-(
Tony reported that 2 days ago, and I sent the fix for it.
http://www.mail-archive.com/linux-omap at vger.kernel.org/msg61520.html
Will drop patch 3 from my series. Incidentally, it doesn't seem necessary to wait for Ben's ack after commit 046d0a37024a5b1e66ec9314e5e7feba42feb811 ("ARM: OMAP: I2C: fix compilation when !CONFIG_OF"), unless Ben disagrees with that change.
- Paul
PATCH 3/3 ARM: OMAP: I2C: fix compilation when !CONFIG_OF
Quoted 1 line · Paul Walmsley
cc Ben, Jean
I'm not involved in this at all.
Jean
Quoted 21 lines · Benoit
Quoted 11 lines
http://lists.ozlabs.org/pipermail/devicetree-discuss/2011-December/010541.html
But it looks like it was stuck in linux-omap dt branch and not pulled for 3.3. Maybe Tony can try to sent it during -rc phase.
That being said, this will be valid for OMAP2+ only and will still break OMAP1 platform :-(
Tony reported that 2 days ago, and I sent the fix for it.
http://www.mail-archive.com/linux-omap at vger.kernel.org/msg61520.htmlWill drop patch 3 from my series. Incidentally, it doesn't seem necessary to wait for Ben's ack after commit
046d0a37024a5b1e66ec9314e5e7feba42feb811("ARM: OMAP: I2C: fix compilation when !CONFIG_OF"), unless Ben disagrees with that change.- Paul