[Gta04-owner] [PATCH] board-omap3gta04: Fix section mismatch error.

Marek Belisko marek.belisko at open-nandra.com
Wed Jul 31 23:43:44 CEST 2013


Fix following:
arch/arm/mach-omap2/board-omap3gta04.c: At top level:
include/linux/init.h:239:20: error: __setup_str_gta04_init_bymux causes a section type conflict with usbhs_bdata

Fix also issue 468 (http://projects.goldelico.com/p/gta04-kernel/issues/468/)

Seems gcc dislike mixing const and non-const data in same section. __setup()
macro is const but usbhs_bdata cannot be const because it must be writable
(usbhs_init()) so move it to different section to fix issue.

Note: same section is used for usbhs_bdata in devkit800, omap3beagle boards..

Signed-off-by: Marek Belisko <marek.belisko at open-nandra.com>
---
 arch/arm/mach-omap2/board-omap3gta04.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap3gta04.c b/arch/arm/mach-omap2/board-omap3gta04.c
index 51888f0..ddb26ec 100644
--- a/arch/arm/mach-omap2/board-omap3gta04.c
+++ b/arch/arm/mach-omap2/board-omap3gta04.c
@@ -1541,7 +1541,7 @@ static struct usbhs_phy_data phy_data[] __initdata = {
 	},
 };
 
-static struct usbhs_omap_platform_data usbhs_bdata __initconst = {
+static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
 
 	/* HSUSB0 - is not a EHCI port; TPS65950 configured by twl4030.c and musb driver */
 	.port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,		/* HSUSB2 - USB3322C <-> WWAN */
@@ -1846,9 +1846,7 @@ static int __init gta04_init_bymux(char *str)
 	return 1;
 }
 
-// FIXME:
-#warning __setup("mux=", gta04_init_bymux);
-#warning results in arch/arm/mach-omap2/board-omap3gta04.c:1851:1: error: __setup_str_gta04_init_bymux causes a section type conflict
+__setup("mux=", gta04_init_bymux);
 
 /* see http://elinux.org/images/4/48/Experiences_With_Device_Tree_Support_Development_For_ARM-Based_SOC's.pdf */
 
-- 
1.8.1.2



More information about the Gta04-owner mailing list