Skip to contentSkip to conversation

omap: fix section mismatch errors

PATCH In review Sanjeev Premi 3 participants 5 messages Aug 16, 2010 – Sep 24, 2010

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 omap: fix section mismatch errors

This patch fixes miltiple section mismatch errors
observed with the latest master.

---
 arch/arm/mach-omap2/board-2430sdp.c          |    2 +-
 arch/arm/mach-omap2/board-apollon.c          |    2 +-
 arch/arm/mach-omap2/board-cm-t35.c           |    8 ++++----
 arch/arm/mach-omap2/board-h4.c               |    2 +-
 arch/arm/mach-omap2/board-zoom-peripherals.c |   18 +++++++++---------
 arch/arm/plat-omap/cpu-omap.c                |    2 +-
 drivers/mfd/twl-core.c                       |    2 +-
 7 files changed, 18 insertions(+), 18 deletions(-)
arch/arm/mach-omap2/board-2430sdp.c +1 -1
index 8538e41..bca0236 100644
@@ -134,7 +134,7 @@ static inline void board_smc91x_init(void)
 
 #endif
 
-static struct omap_board_config_kernel sdp2430_config[] = {
+static struct omap_board_config_kernel sdp2430_config[] __initdata = {
 	{OMAP_TAG_LCD, &sdp2430_lcd_config},
 };
 
arch/arm/mach-omap2/board-apollon.c +1 -1
index c6421a7..1401108 100644
@@ -270,7 +270,7 @@ static struct omap_lcd_config apollon_lcd_config __initdata = {
 	.ctrl_name	= "internal",
 };
 
-static struct omap_board_config_kernel apollon_config[] = {
+static struct omap_board_config_kernel apollon_config[] __initdata = {
 	{ OMAP_TAG_LCD,		&apollon_lcd_config },
 };
 
arch/arm/mach-omap2/board-cm-t35.c +4 -4
index e10bc10..fc04062 100644
@@ -606,7 +606,7 @@ static struct ehci_hcd_omap_platform_data ehci_pdata __initdata = {
 	.reset_gpio_port[2]  = -EINVAL
 };
 
-static int cm_t35_twl_gpio_setup(struct device *dev, unsigned gpio,
+static int __init cm_t35_twl_gpio_setup(struct device *dev, unsigned gpio,
 				 unsigned ngpio)
 {
 	int wlan_rst = gpio + 2;
@@ -640,14 +640,14 @@ static int cm_t35_twl_gpio_setup(struct device *dev, unsigned gpio,
 	return 0;
 }
 
-static struct twl4030_gpio_platform_data cm_t35_gpio_data = {
+static struct twl4030_gpio_platform_data cm_t35_gpio_data __initdata = {
 	.gpio_base	= OMAP_MAX_GPIO_LINES,
 	.irq_base	= TWL4030_GPIO_IRQ_BASE,
 	.irq_end	= TWL4030_GPIO_IRQ_END,
 	.setup          = cm_t35_twl_gpio_setup,
 };
 
-static struct twl4030_platform_data cm_t35_twldata = {
+static struct twl4030_platform_data cm_t35_twldata __initdata = {
 	.irq_base	= TWL4030_IRQ_BASE,
 	.irq_end	= TWL4030_IRQ_END,
 
@@ -661,7 +661,7 @@ static struct twl4030_platform_data cm_t35_twldata = {
 	.vpll2		= &cm_t35_vpll2,
 };
 
-static struct i2c_board_info __initdata cm_t35_i2c_boardinfo[] = {
+static struct i2c_board_info __initdata cm_t35_i2c_boardinfo[] __initdata = {
 	{
 		I2C_BOARD_INFO("tps65930", 0x48),
 		.flags		= I2C_CLIENT_WAKE,
arch/arm/mach-omap2/board-h4.c +1 -1
index e09bd68..7b6f9c1 100644
@@ -283,7 +283,7 @@ static struct omap_usb_config h4_usb_config __initdata = {
 	.hmc_mode	= 0x00,		/* 0:dev|otg 1:disable 2:disable */
 };
 
-static struct omap_board_config_kernel h4_config[] = {
+static struct omap_board_config_kernel h4_config[] __initdata = {
 	{ OMAP_TAG_LCD,		&h4_lcd_config },
 };
 
arch/arm/mach-omap2/board-zoom-peripherals.c +9 -9
index 6b39849..d0f8057 100644
@@ -171,7 +171,7 @@ static struct omap2_hsmmc_info mmc[] __initdata = {
 	{}      /* Terminator */
 };
 
-static int zoom_twl_gpio_setup(struct device *dev,
+static int __init zoom_twl_gpio_setup(struct device *dev,
 		unsigned gpio, unsigned ngpio)
 {
 	/* gpio + 0 is "mmc0_cd" (input/IRQ) */
@@ -209,27 +209,27 @@ static struct twl4030_usb_data zoom_usb_data = {
 	.usb_mode	= T2_USB_MODE_ULPI,
 };
 
-static struct twl4030_gpio_platform_data zoom_gpio_data = {
+static struct twl4030_gpio_platform_data zoom_gpio_data __initdata = {
 	.gpio_base	= OMAP_MAX_GPIO_LINES,
 	.irq_base	= TWL4030_GPIO_IRQ_BASE,
 	.irq_end	= TWL4030_GPIO_IRQ_END,
 	.setup		= zoom_twl_gpio_setup,
 };
 
-static struct twl4030_madc_platform_data zoom_madc_data = {
+static struct twl4030_madc_platform_data zoom_madc_data __initdata = {
 	.irq_line	= 1,
 };
 
-static struct twl4030_codec_audio_data zoom_audio_data = {
+static struct twl4030_codec_audio_data zoom_audio_data __initdata = {
 	.audio_mclk = 26000000,
 };
 
-static struct twl4030_codec_data zoom_codec_data = {
+static struct twl4030_codec_data zoom_codec_data __initdata = {
 	.audio_mclk = 26000000,
 	.audio = &zoom_audio_data,
 };
 
-static struct twl4030_platform_data zoom_twldata = {
+static struct twl4030_platform_data zoom_twldata __initdata = {
 	.irq_base	= TWL4030_IRQ_BASE,
 	.irq_end	= TWL4030_IRQ_END,
 
@@ -246,7 +246,7 @@ static struct twl4030_platform_data zoom_twldata = {
 
 };
 
-static struct i2c_board_info __initdata zoom_i2c_boardinfo[] = {
+static struct i2c_board_info __initdata zoom_i2c_boardinfo[] __initdata = {
 	{
 		I2C_BOARD_INFO("twl5030", 0x48),
 		.flags		= I2C_CLIENT_WAKE,
@@ -264,13 +264,13 @@ static int __init omap_i2c_init(void)
 	return 0;
 }
 
-static struct omap_musb_board_data musb_board_data = {
+static struct omap_musb_board_data musb_board_data __initdata = {
 	.interface_type		= MUSB_INTERFACE_ULPI,
 	.mode			= MUSB_OTG,
 	.power			= 100,
 };
 
-static void enable_board_wakeup_source(void)
+static void __init enable_board_wakeup_source(void)
 {
 	/* T2 interrupt line (keypad) */
 	omap_mux_init_signal("sys_nirq",
arch/arm/plat-omap/cpu-omap.c +1 -1
index 6d3d333..e47a299 100644
@@ -144,7 +144,7 @@ static struct freq_attr *omap_cpufreq_attr[] = {
 	NULL,
 };
 
-static struct cpufreq_driver omap_driver = {
+static struct cpufreq_driver omap_driver __refdata = {
 	.flags		= CPUFREQ_STICKY,
 	.verify		= omap_verify_speed,
 	.target		= omap_target,
drivers/mfd/twl-core.c +1 -1
index 720e099..36f4c48 100644
@@ -1061,7 +1061,7 @@ static const struct i2c_device_id twl_ids[] = {
 MODULE_DEVICE_TABLE(i2c, twl_ids);
 
 /* One Client Driver , 4 Clients */
-static struct i2c_driver twl_driver = {
+static struct i2c_driver twl_driver __refdata = {
 	.driver.name	= DRIVER_NAME,
 	.id_table	= twl_ids,
 	.probe		= twl_probe,
Signature · 1 line
1.6.6.1
maintainer
#1 lore raw
Quoted 2 lines · Sanjeev Premi

This patch fixes miltiple section mismatch errors
observed with the latest master.

Few comments below.

arch/arm/mach-omap2/board-2430sdp.c static inline void board_smc91x_init(void) · line 139

Quoted 8 lines
arch/arm/mach-omap2/board-2430sdp.c +1 -1
@@ -134,7 +134,7 @@ static inline void board_smc91x_init(void)
 
 #endif
 
-static struct omap_board_config_kernel sdp2430_config[] = {
+static struct omap_board_config_kernel sdp2430_config[] __initdata = {
 	{OMAP_TAG_LCD, &sdp2430_lcd_config},
 };

...

Let's just get rid of omap_get_config stuff. The OMAP_TAG_LCD and OMAP_TAG_FBMEM are the last remaining legacy tags. They should be replaced with just platform_data. And while at it, it should be done for all the boards.

Tomi, do you see any problems with that?

arch/arm/mach-omap2/board-zoom-peripherals.c static struct omap2_hsmmc_info mmc[] __initdata = { · line 177

Quoted 11 lines
arch/arm/mach-omap2/board-zoom-peripherals.c +1 -1
@@ -171,7 +171,7 @@ static struct omap2_hsmmc_info mmc[] __initdata = {
 	{}      /* Terminator */
 };
 
-static int zoom_twl_gpio_setup(struct device *dev,
+static int __init zoom_twl_gpio_setup(struct device *dev,
 		unsigned gpio, unsigned ngpio)
 {
 	/* gpio + 0 is "mmc0_cd" (input/IRQ) */

This should be safe to do for all the board, pdata->setup is only called during the probe.

arch/arm/mach-omap2/board-zoom-peripherals.c static struct twl4030_usb_data zoom_usb_data = { · line 217

Quoted 11 lines
arch/arm/mach-omap2/board-zoom-peripherals.c +1 -1
@@ -209,27 +209,27 @@ static struct twl4030_usb_data zoom_usb_data = {
 	.usb_mode	= T2_USB_MODE_ULPI,
 };
 
-static struct twl4030_gpio_platform_data zoom_gpio_data = {
+static struct twl4030_gpio_platform_data zoom_gpio_data __initdata = {
 	.gpio_base	= OMAP_MAX_GPIO_LINES,
 	.irq_base	= TWL4030_GPIO_IRQ_BASE,
 	.irq_end	= TWL4030_GPIO_IRQ_END,
 	.setup		= zoom_twl_gpio_setup,
 };

But this is not safe to do as twl4030-gpio.c uses pdata in gpio_twl4030_remove.

It's best to split the initdata changes so you make one change for all the boards per patch, that way it's possible to check if it's OK to do that change from the driver point of view.

Regards,

Tony

#2 lore raw
Quoted 16 lines · ext Tony Lindgren
Quoted 2 lines · Sanjeev Premi

This patch fixes miltiple section mismatch errors
observed with the latest master.

Few comments below.

Quoted 8 lines
arch/arm/mach-omap2/board-2430sdp.c +1 -1
@@ -134,7 +134,7 @@ static inline void board_smc91x_init(void)
 
 #endif
 
-static struct omap_board_config_kernel sdp2430_config[] = {
+static struct omap_board_config_kernel sdp2430_config[] __initdata = {
 	{OMAP_TAG_LCD, &sdp2430_lcd_config},
 };

...

Quoted 6 lines

Let's just get rid of omap_get_config stuff. The OMAP_TAG_LCD and OMAP_TAG_FBMEM are the last remaining legacy tags. They should be replaced with just platform_data. And while at it, it should be done for all the boards.

Tomi, do you see any problems with that?

OMAP_TAG_LCD and OMAP_TAG_FBMEM are used by the old omapfb driver.

I don't see any problem in changing them to platform data, except that it's some work and somebody should do it =).

Tomi

#3 lore raw
Quoted 30 lines

-----Original Message-----
From: Tomi Valkeinen [mailto:[email protected]]
Sent: Friday, September 24, 2010 2:10 PM
To: ext Tony Lindgren
Cc: Premi, Sanjeev; [email protected]
Subject: Re: [PATCH 1/1] omap: fix section mismatch errors

Quoted 4 lines · ext Tony Lindgren
Quoted 2 lines · Sanjeev Premi

This patch fixes miltiple section mismatch errors
observed with the latest master.

Quoted 8 lines

Few comments below.

arch/arm/mach-omap2/board-2430sdp.c static inline void board_smc91x_init(void) · line 137

Quoted 6 lines
arch/arm/mach-omap2/board-2430sdp.c +1 -1
@@ -134,7 +134,7 @@ static inline void board_smc91x_init(void)
 
 #endif
 
-static struct omap_board_config_kernel sdp2430_config[] = {
+static struct omap_board_config_kernel sdp2430_config[] 

__initdata = {

Quoted 9 lines

arch/arm/mach-omap2/board-2430sdp.c static inline void board_smc91x_init(void) · line 139

Quoted 2 lines
arch/arm/mach-omap2/board-2430sdp.c +0 -0
 	{OMAP_TAG_LCD, &sdp2430_lcd_config},
 };

...

Let's just get rid of omap_get_config stuff. The OMAP_TAG_LCD and OMAP_TAG_FBMEM are the last remaining legacy tags. They should be replaced with just platform_data. And while at it, it should be done for all the boards.

Quoted 9 lines
Quoted 1 line

Tomi, do you see any problems with that?

OMAP_TAG_LCD and OMAP_TAG_FBMEM are used by the old omapfb driver.

I don't see any problem in changing them to platform data, except that it's some work and somebody should do it =).

Tomi

Tony,

Can we do this as a separate patch? Or should I go down this path in same context?... it may delay this patch.

~sanjeev

Quoted 2 lines
maintainer
#4 lore raw
Quoted 37 lines · Premi, Sanjeev
Quoted 37 lines

-----Original Message-----
From: Tomi Valkeinen [mailto:[email protected]]
Sent: Friday, September 24, 2010 2:10 PM
To: ext Tony Lindgren
Cc: Premi, Sanjeev; [email protected]
Subject: Re: [PATCH 1/1] omap: fix section mismatch errors

Quoted 4 lines · ext Tony Lindgren
Quoted 2 lines · Sanjeev Premi

This patch fixes miltiple section mismatch errors
observed with the latest master.

Quoted 8 lines

Few comments below.

arch/arm/mach-omap2/board-2430sdp.c static inline void board_smc91x_init(void) · line 137

Quoted 6 lines
arch/arm/mach-omap2/board-2430sdp.c +1 -1
@@ -134,7 +134,7 @@ static inline void board_smc91x_init(void)
 
 #endif
 
-static struct omap_board_config_kernel sdp2430_config[] = {
+static struct omap_board_config_kernel sdp2430_config[] 

__initdata = {

Quoted 10 lines

arch/arm/mach-omap2/board-2430sdp.c static inline void board_smc91x_init(void) · line 139

Quoted 2 lines
arch/arm/mach-omap2/board-2430sdp.c +0 -0
 	{OMAP_TAG_LCD, &sdp2430_lcd_config},
 };

...

Let's just get rid of omap_get_config stuff. The OMAP_TAG_LCD and OMAP_TAG_FBMEM are the last remaining legacy tags. They should be replaced with just platform_data. And while at it, it should be done for all the boards.

Tomi, do you see any problems with that?

OMAP_TAG_LCD and OMAP_TAG_FBMEM are used by the old omapfb driver.

I don't see any problem in changing them to platform data, except that it's some work and somebody should do it =).

Quoted 6 lines
Quoted 2 lines

Tomi

Tony,

Can we do this as a separate patch? Or should I go down this path in same context?... it may delay this patch.

Sounds like a separate patch. But let's not create noise about OMAP_TAG_LCD related warnings if we intent to remove them later on anyways.

Tony