Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b370e082 authored by Hartley Sweeten's avatar Hartley Sweeten Committed by Russell King
Browse files

ARM: 5992/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.

Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Acked-by: default avatarRyan Mallon <ryan@bluewatersys.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent b0c4c898
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -41,7 +41,7 @@ static struct platform_device adssphere_flash = {
	.resource	= &adssphere_flash_resource,
	.resource	= &adssphere_flash_resource,
};
};


static struct ep93xx_eth_data adssphere_eth_data = {
static struct ep93xx_eth_data __initdata adssphere_eth_data = {
	.phy_id		= 1,
	.phy_id		= 1,
};
};


+44 −13
Original line number Original line Diff line number Diff line
@@ -330,6 +330,10 @@ static struct platform_device ep93xx_ohci_device = {
	.resource	= ep93xx_ohci_resources,
	.resource	= ep93xx_ohci_resources,
};
};



/*************************************************************************
 * EP93xx ethernet peripheral handling
 *************************************************************************/
static struct ep93xx_eth_data ep93xx_eth_data;
static struct ep93xx_eth_data ep93xx_eth_data;


static struct resource ep93xx_eth_resource[] = {
static struct resource ep93xx_eth_resource[] = {
@@ -354,6 +358,12 @@ static struct platform_device ep93xx_eth_device = {
	.resource	= ep93xx_eth_resource,
	.resource	= ep93xx_eth_resource,
};
};


/**
 * ep93xx_register_eth - Register the built-in ethernet platform device.
 * @data:	platform specific ethernet configuration (__initdata)
 * @copy_addr:	flag indicating that the MAC address should be copied
 *		from the IndAd registers (as programmed by the bootloader)
 */
void __init ep93xx_register_eth(struct ep93xx_eth_data *data, int copy_addr)
void __init ep93xx_register_eth(struct ep93xx_eth_data *data, int copy_addr)
{
{
	if (copy_addr)
	if (copy_addr)
@@ -372,9 +382,17 @@ static struct i2c_gpio_platform_data ep93xx_i2c_data;
static struct platform_device ep93xx_i2c_device = {
static struct platform_device ep93xx_i2c_device = {
	.name		= "i2c-gpio",
	.name		= "i2c-gpio",
	.id		= 0,
	.id		= 0,
	.dev.platform_data	= &ep93xx_i2c_data,
	.dev		= {
		.platform_data	= &ep93xx_i2c_data,
	},
};
};


/**
 * ep93xx_register_i2c - Register the i2c platform device.
 * @data:	platform specific i2c-gpio configuration (__initdata)
 * @devices:	platform specific i2c bus device information (__initdata)
 * @num:	the number of devices on the i2c bus
 */
void __init ep93xx_register_i2c(struct i2c_gpio_platform_data *data,
void __init ep93xx_register_i2c(struct i2c_gpio_platform_data *data,
				struct i2c_board_info *devices, int num)
				struct i2c_board_info *devices, int num)
{
{
@@ -536,6 +554,10 @@ static struct platform_device ep93xx_fb_device = {
	.resource		= ep93xx_fb_resource,
	.resource		= ep93xx_fb_resource,
};
};


/**
 * ep93xx_register_fb - Register the framebuffer platform device.
 * @data:	platform specific framebuffer configuration (__initdata)
 */
void __init ep93xx_register_fb(struct ep93xxfb_mach_info *data)
void __init ep93xx_register_fb(struct ep93xxfb_mach_info *data)
{
{
	ep93xxfb_data = *data;
	ep93xxfb_data = *data;
@@ -546,6 +568,8 @@ void __init ep93xx_register_fb(struct ep93xxfb_mach_info *data)
/*************************************************************************
/*************************************************************************
 * EP93xx matrix keypad peripheral handling
 * EP93xx matrix keypad peripheral handling
 *************************************************************************/
 *************************************************************************/
static struct ep93xx_keypad_platform_data ep93xx_keypad_data;

static struct resource ep93xx_keypad_resource[] = {
static struct resource ep93xx_keypad_resource[] = {
	{
	{
		.start	= EP93XX_KEY_MATRIX_PHYS_BASE,
		.start	= EP93XX_KEY_MATRIX_PHYS_BASE,
@@ -561,13 +585,20 @@ static struct resource ep93xx_keypad_resource[] = {
static struct platform_device ep93xx_keypad_device = {
static struct platform_device ep93xx_keypad_device = {
	.name		= "ep93xx-keypad",
	.name		= "ep93xx-keypad",
	.id		= -1,
	.id		= -1,
	.dev		= {
		.platform_data	= &ep93xx_keypad_data,
	},
	.num_resources	= ARRAY_SIZE(ep93xx_keypad_resource),
	.num_resources	= ARRAY_SIZE(ep93xx_keypad_resource),
	.resource	= ep93xx_keypad_resource,
	.resource	= ep93xx_keypad_resource,
};
};


/**
 * ep93xx_register_keypad - Register the keypad platform device.
 * @data:	platform specific keypad configuration (__initdata)
 */
void __init ep93xx_register_keypad(struct ep93xx_keypad_platform_data *data)
void __init ep93xx_register_keypad(struct ep93xx_keypad_platform_data *data)
{
{
	ep93xx_keypad_device.dev.platform_data = data;
	ep93xx_keypad_data = *data;
	platform_device_register(&ep93xx_keypad_device);
	platform_device_register(&ep93xx_keypad_device);
}
}


+2 −2
Original line number Original line Diff line number Diff line
@@ -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,
	.phy_id		= 1,
};
};


@@ -82,7 +82,7 @@ static struct ep93xx_eth_data edb93xx_eth_data = {
/*************************************************************************
/*************************************************************************
 * EDB93xx i2c peripheral handling
 * 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_pin		= EP93XX_GPIO_LINE_EEDAT,
	.sda_is_open_drain	= 0,
	.sda_is_open_drain	= 0,
	.scl_pin		= EP93XX_GPIO_LINE_EECLK,
	.scl_pin		= EP93XX_GPIO_LINE_EECLK,
+1 −1
Original line number Original line Diff line number Diff line
@@ -41,7 +41,7 @@ static struct platform_device gesbc9312_flash = {
	.resource	= &gesbc9312_flash_resource,
	.resource	= &gesbc9312_flash_resource,
};
};


static struct ep93xx_eth_data gesbc9312_eth_data = {
static struct ep93xx_eth_data __initdata gesbc9312_eth_data = {
	.phy_id		= 1,
	.phy_id		= 1,
};
};


+1 −1
Original line number Original line Diff line number Diff line
@@ -80,7 +80,7 @@ static void __init micro9_register_flash(void)
/*************************************************************************
/*************************************************************************
 * Micro9 Ethernet
 * Micro9 Ethernet
 *************************************************************************/
 *************************************************************************/
static struct ep93xx_eth_data micro9_eth_data = {
static struct ep93xx_eth_data __initdata micro9_eth_data = {
	.phy_id		= 0x1f,
	.phy_id		= 0x1f,
};
};


Loading