omap2/3/4: ehci: avoid compiler error with touchbook
authorFelipe Balbi <felipe.balbi@nokia.com>
Thu, 4 Mar 2010 07:45:53 +0000 (09:45 +0200)
committerTony Lindgren <tony@atomide.com>
Thu, 11 Mar 2010 17:32:03 +0000 (09:32 -0800)
the early_param() call in board-omap3touchbook.c expands to:

static const char __setup_str_early_touchbook_revision[]
__section(.init.rodata) _aligned(1) = tbr;
[...]

and we have a non-const variable being added to the
same section:

static struct ehci_hcd_omap_platform_data ehci_pdata
__section(.init.rodata);

because of that, gcc generates a section type conflict
which can (and actually should) be avoided by marking
const every variable marked with __initconst.

This patch fixes that for the ehci_hdc_omap_platform_data.

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 files changed:
arch/arm/mach-omap2/board-3430sdp.c
arch/arm/mach-omap2/board-3630sdp.c
arch/arm/mach-omap2/board-am3517evm.c
arch/arm/mach-omap2/board-cm-t35.c
arch/arm/mach-omap2/board-devkit8000.c
arch/arm/mach-omap2/board-igep0020.c
arch/arm/mach-omap2/board-omap3beagle.c
arch/arm/mach-omap2/board-omap3evm.c
arch/arm/mach-omap2/board-omap3pandora.c
arch/arm/mach-omap2/board-omap3touchbook.c
arch/arm/mach-omap2/board-overo.c
arch/arm/mach-omap2/board-zoom3.c
arch/arm/mach-omap2/usb-ehci.c
arch/arm/plat-omap/include/plat/usb.h

index a101029ceb6f55e86feecbf9e9cc126d466ad0b3..5822bcf7b15fa07e588f5a51c342c8f38c62425d 100644 (file)
@@ -648,7 +648,7 @@ static void enable_board_wakeup_source(void)
                OMAP_WAKEUP_EN | OMAP_PIN_INPUT_PULLUP);
 }
 
-static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
+static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
 
        .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
        .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY,
index 4386d2b4a785dcceaaecacb245024442312464d0..a0a2a113465cc01f8baf263448d3f955a6b0de8f 100755 (executable)
@@ -54,7 +54,7 @@ static void enable_board_wakeup_source(void)
                OMAP_WAKEUP_EN | OMAP_PIN_INPUT_PULLUP);
 }
 
-static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
+static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
 
        .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
        .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY,
index 70c18614773c60cd119300ef51065e89fd9c8b8f..6ae880585d54d7698ccd2414755bff59c69dc46f 100644 (file)
@@ -273,7 +273,7 @@ static void __init am3517_evm_init_irq(void)
        omap_gpio_init();
 }
 
-static struct ehci_hcd_omap_platform_data ehci_pdata __initdata = {
+static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
        .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
        .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY,
        .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
index afa77caaff4dece9cc58bc3b469735f4651aba39..2de4f79f03a0f226e7df5b4a1df20175e17c5965 100644 (file)
@@ -612,7 +612,7 @@ static struct omap2_hsmmc_info mmc[] = {
        {}      /* Terminator */
 };
 
-static struct ehci_hcd_omap_platform_data ehci_pdata = {
+static struct ehci_hcd_omap_platform_data ehci_pdata __initdata = {
        .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
        .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY,
        .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
index 371019054b494c713f19de50310e7b521cc3459d..5bfc13b3176c9fad46a686bf0954fb24dcddee44 100644 (file)
@@ -636,7 +636,7 @@ static struct omap_musb_board_data musb_board_data = {
        .power                  = 100,
 };
 
-static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
+static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
 
        .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
        .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY,
index 9958987a3d0a8456761825c9577ddf0953355eb8..4f1accf7f7f372e95229ea63c405e9d21dd65fa1 100644 (file)
@@ -442,7 +442,7 @@ static struct omap_musb_board_data musb_board_data = {
        .power                  = 100,
 };
 
-static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
+static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
        .port_mode[0] = EHCI_HCD_OMAP_MODE_UNKNOWN,
        .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY,
        .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
index 6eb77e1f7c828b04c27f4742aff108f2f4c74eee..962d377970e9bb198d410abf1ac1b418d0658341 100644 (file)
@@ -410,7 +410,7 @@ static void __init omap3beagle_flash_init(void)
        }
 }
 
-static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
+static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
 
        .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
        .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY,
index d6bc88c426b560bace561b402e28d7817f7d457f..017bb2f4f7d292a65acda7aafb29e20e5d7bbfc7 100644 (file)
@@ -635,7 +635,7 @@ static struct platform_device *omap3_evm_devices[] __initdata = {
        &omap3_evm_dss_device,
 };
 
-static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
+static struct ehci_hcd_omap_platform_data ehci_pdata __initdata = {
 
        .port_mode[0] = EHCI_HCD_OMAP_MODE_UNKNOWN,
        .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY,
index 4827f4658df391ab3023c25e28d7ca7901628417..51a5315519c4b558a6e905c8d7e21ed8b324a4a5 100644 (file)
@@ -537,7 +537,7 @@ static struct platform_device *omap3pandora_devices[] __initdata = {
        &pandora_dss_device,
 };
 
-static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
+static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
 
        .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
        .port_mode[1] = EHCI_HCD_OMAP_MODE_UNKNOWN,
index 2a5bf5cea8833d95d96033a1ddf5a222ff8de490..2504d41f923e01bcbf6dd82b92ceb03139c1c8bf 100644 (file)
@@ -493,7 +493,7 @@ static void __init omap3touchbook_flash_init(void)
        }
 }
 
-static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
+static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
 
        .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
        .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY,
index 50872a42bec74c3dbafe6c686a8ad0c5ce2d9bbf..8848c7c5ce48d03a58bb8f758583b0ee0ab27b3e 100644 (file)
@@ -394,7 +394,7 @@ static struct platform_device *overo_devices[] __initdata = {
        &overo_lcd_device,
 };
 
-static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
+static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
        .port_mode[0] = EHCI_HCD_OMAP_MODE_UNKNOWN,
        .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY,
        .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
index d3e3cd5170d12b17ea18c98f4f496b0233c0c4d3..cd3e40cf3ac1f5df07576963ddf150593886477d 100644 (file)
@@ -52,7 +52,7 @@ static struct omap_board_mux board_mux[] __initdata = {
 #define board_mux      NULL
 #endif
 
-static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
+static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
        .port_mode[0]           = EHCI_HCD_OMAP_MODE_UNKNOWN,
        .port_mode[1]           = EHCI_HCD_OMAP_MODE_PHY,
        .port_mode[2]           = EHCI_HCD_OMAP_MODE_UNKNOWN,
index f1df873d59dbf881b9d6a60e01ea9dab1fc1a845..ee9f548d5d8177cf839b333e97617966b01aa2b4 100644 (file)
@@ -70,7 +70,7 @@ static struct platform_device ehci_device = {
 /*
  * setup_ehci_io_mux - initialize IO pad mux for USBHOST
  */
-static void setup_ehci_io_mux(enum ehci_hcd_omap_mode *port_mode)
+static void setup_ehci_io_mux(const enum ehci_hcd_omap_mode *port_mode)
 {
        switch (port_mode[0]) {
        case EHCI_HCD_OMAP_MODE_PHY:
@@ -213,7 +213,7 @@ static void setup_ehci_io_mux(enum ehci_hcd_omap_mode *port_mode)
        return;
 }
 
-void __init usb_ehci_init(struct ehci_hcd_omap_platform_data *pdata)
+void __init usb_ehci_init(const struct ehci_hcd_omap_platform_data *pdata)
 {
        platform_device_add_data(&ehci_device, pdata, sizeof(*pdata));
 
@@ -229,7 +229,7 @@ void __init usb_ehci_init(struct ehci_hcd_omap_platform_data *pdata)
 
 #else
 
-void __init usb_ehci_init(struct ehci_hcd_omap_platform_data *pdata)
+void __init usb_ehci_init(const struct ehci_hcd_omap_platform_data *pdata)
 
 {
 }
index 288e29e1c06f52f6c187b8681e75ef0586a82306..568578db93b659475d13935b09aa5df800c35cb8 100644 (file)
@@ -53,7 +53,7 @@ enum musb_interface    {MUSB_INTERFACE_ULPI, MUSB_INTERFACE_UTMI};
 
 extern void usb_musb_init(struct omap_musb_board_data *board_data);
 
-extern void usb_ehci_init(struct ehci_hcd_omap_platform_data *pdata);
+extern void usb_ehci_init(const struct ehci_hcd_omap_platform_data *pdata);
 
 #endif