Skip to contentSkip to conversation

ep93xx: pass platform startup data as __initdata

PATCH New H Hartley Sweeten 2 participants 2 messages Mar 17, 2010

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

PATCH 1/1 ep93xx: pass platform startup data as __initdata

A number of the peripherals for the ep93xx are registered at startup using platform_data that is passed from the board init code to the core code. This data is then copied to a local static variable in the core code. Since the data is copied, the original data can be marked as __initdata and discarded after startup is complete.

This adds the __initdata tag to all the appropriate data in the various ep93xx board init's. Specifically, all the struct ep93xx_eth_data, struct ep93xxfb_mach_info, and struct i2c_gpio_platform_data.

Also, document the various registration functions and note what data should be marked as __initdata.

While here, also cleanup a couple over zealous whitespace tabs.

---

arch/arm/mach-ep93xx/adssphere.c +1 -1
index caf6d51..3a1a855 100644
@@ -41,7 +41,7 @@ static struct platform_device adssphere_flash = {
 	.resource	= &adssphere_flash_resource,
 };
 
-static struct ep93xx_eth_data adssphere_eth_data = {
+static struct ep93xx_eth_data __initdata adssphere_eth_data = {
 	.phy_id		= 1,
 };
 
arch/arm/mach-ep93xx/core.c +44 -13

112 lines not on this page · raw message

arch/arm/mach-ep93xx/edb93xx.c +2 -2
index d22d67a..3884182 100644
@@ -74,7 +74,7 @@ static void __init edb93xx_register_flash(void)
 	}
 }
 
-static struct ep93xx_eth_data edb93xx_eth_data = {
+static struct ep93xx_eth_data __initdata edb93xx_eth_data = {
 	.phy_id		= 1,
 };
 
@@ -82,7 +82,7 @@ static struct ep93xx_eth_data edb93xx_eth_data = {
 /*************************************************************************
  * EDB93xx i2c peripheral handling
  *************************************************************************/
-static struct i2c_gpio_platform_data edb93xx_i2c_gpio_data = {
+static struct i2c_gpio_platform_data __initdata edb93xx_i2c_gpio_data = {
 	.sda_pin		= EP93XX_GPIO_LINE_EEDAT,
 	.sda_is_open_drain	= 0,
 	.scl_pin		= EP93XX_GPIO_LINE_EECLK,
arch/arm/mach-ep93xx/gesbc9312.c +1 -1
index 3da7ca8..a809618 100644
@@ -41,7 +41,7 @@ static struct platform_device gesbc9312_flash = {
 	.resource	= &gesbc9312_flash_resource,
 };
 
-static struct ep93xx_eth_data gesbc9312_eth_data = {
+static struct ep93xx_eth_data __initdata gesbc9312_eth_data = {
 	.phy_id		= 1,
 };
 
arch/arm/mach-ep93xx/micro9.c +1 -1
index c33360e..1cc911b 100644
@@ -80,7 +80,7 @@ static void __init micro9_register_flash(void)
 /*************************************************************************
  * Micro9 Ethernet
  *************************************************************************/
-static struct ep93xx_eth_data micro9_eth_data = {
+static struct ep93xx_eth_data __initdata micro9_eth_data = {
 	.phy_id		= 0x1f,
 };
 
arch/arm/mach-ep93xx/simone.c +3 -3
index cd93990..388aec9 100644
@@ -49,17 +49,17 @@ static struct platform_device simone_flash = {
 	},
 };
 
-static struct ep93xx_eth_data simone_eth_data = {
+static struct ep93xx_eth_data __initdata simone_eth_data = {
 	.phy_id		= 1,
 };
 
-static struct ep93xxfb_mach_info simone_fb_info = {
+static struct ep93xxfb_mach_info __initdata simone_fb_info = {
 	.num_modes	= EP93XXFB_USE_MODEDB,
 	.bpp		= 16,
 	.flags		= EP93XXFB_USE_SDCSN0 | EP93XXFB_PCLK_FALLING,
 };
 
-static struct i2c_gpio_platform_data simone_i2c_gpio_data = {
+static struct i2c_gpio_platform_data __initdata simone_i2c_gpio_data = {
 	.sda_pin		= EP93XX_GPIO_LINE_EEDAT,
 	.sda_is_open_drain	= 0,
 	.scl_pin		= EP93XX_GPIO_LINE_EECLK,
arch/arm/mach-ep93xx/snappercl15.c +3 -3
index 51134b0..38deaee 100644
@@ -125,11 +125,11 @@ static struct platform_device snappercl15_nand_device = {
 	.num_resources		= ARRAY_SIZE(snappercl15_nand_resource),
 };
 
-static struct ep93xx_eth_data snappercl15_eth_data = {
+static struct ep93xx_eth_data __initdata snappercl15_eth_data = {
 	.phy_id			= 1,
 };
 
-static struct i2c_gpio_platform_data snappercl15_i2c_gpio_data = {
+static struct i2c_gpio_platform_data __initdata snappercl15_i2c_gpio_data = {
 	.sda_pin		= EP93XX_GPIO_LINE_EEDAT,
 	.sda_is_open_drain	= 0,
 	.scl_pin		= EP93XX_GPIO_LINE_EECLK,
@@ -145,7 +145,7 @@ static struct i2c_board_info __initdata snappercl15_i2c_data[] = {
 	},
 };
 
-static struct ep93xxfb_mach_info snappercl15_fb_info = {
+static struct ep93xxfb_mach_info __initdata snappercl15_fb_info = {
 	.num_modes		= EP93XXFB_USE_MODEDB,
 	.bpp			= 16,
 };
arch/arm/mach-ep93xx/ts72xx.c +1 -1
index fac1ec7..9553031 100644
@@ -186,7 +186,7 @@ static struct platform_device ts72xx_wdt_device = {
 	.resource	= ts72xx_wdt_resources,
 };
 
-static struct ep93xx_eth_data ts72xx_eth_data = {
+static struct ep93xx_eth_data __initdata ts72xx_eth_data = {
 	.phy_id		= 1,
 };
 
#1 lore raw

PATCH 1/1 ep93xx: pass platform startup data as __initdata

Quoted 12 lines · H Hartley Sweeten

A number of the peripherals for the ep93xx are registered at startup using platform_data that is passed from the board init code to the core code. This data is then copied to a local static variable in the core code. Since the data is copied, the original data can be marked as __initdata and discarded after startup is complete.

This adds the __initdata tag to all the appropriate data in the various ep93xx board init's. Specifically, all the struct ep93xx_eth_data, struct ep93xxfb_mach_info, and struct i2c_gpio_platform_data.

Quoted 7 lines

Also, document the various registration functions and note what data should be marked as __initdata.

While here, also cleanup a couple over zealous whitespace tabs.

Looks good, and appears to work okay.

Signature · 7 lines
Bluewater Systems Ltd - ARM Technology Solution Centre

Ryan Mallon         		5 Amuri Park, 404 Barbadoes St
ryan at bluewatersys.com         	PO Box 13 889, Christchurch 8013
http://www.bluewatersys.com	New Zealand
Phone: +64 3 3779127		Freecall: Australia 1800 148 751
Fax:   +64 3 3779135			  USA 1800 261 2934