aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/gpmc-smsc911x.c
diff options
context:
space:
mode:
authorMike Rapoport <mike@compulab.co.il>2011-04-16 18:29:30 -0400
committerTony Lindgren <tony@atomide.com>2011-04-20 11:54:09 -0400
commit21b42731e6ab1ccbbe9ad1b639c5d78eecad8432 (patch)
treec5ce62ea21eafb712c8d20fa0b683b1ec2e4e737 /arch/arm/mach-omap2/gpmc-smsc911x.c
parentf0949f73a75093fb86d6554101bd79046633a297 (diff)
omap: convert boards that use SMSC911x to use gpmc-smsc911x
Convert boards that use SMSC911x to use gpmc-smsc911x. Also allocate struct platform_device dynamically. Signed-off-by: Mike Rapoport <mike@compulab.co.il> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il> [tony@atomide.com: folded in a fix from Igor Grindberg] Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/gpmc-smsc911x.c')
-rw-r--r--arch/arm/mach-omap2/gpmc-smsc911x.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/arch/arm/mach-omap2/gpmc-smsc911x.c b/arch/arm/mach-omap2/gpmc-smsc911x.c
index b331f3cd38f1..d30293a36494 100644
--- a/arch/arm/mach-omap2/gpmc-smsc911x.c
+++ b/arch/arm/mach-omap2/gpmc-smsc911x.c
@@ -41,16 +41,6 @@ static struct smsc911x_platform_config gpmc_smsc911x_config = {
41 .flags = SMSC911X_USE_16BIT, 41 .flags = SMSC911X_USE_16BIT,
42}; 42};
43 43
44static struct platform_device gpmc_smsc911x_device = {
45 .name = "smsc911x",
46 .id = -1,
47 .num_resources = ARRAY_SIZE(gpmc_smsc911x_resources),
48 .resource = gpmc_smsc911x_resources,
49 .dev = {
50 .platform_data = &gpmc_smsc911x_config,
51 },
52};
53
54/* 44/*
55 * Initialize smsc911x device connected to the GPMC. Note that we 45 * Initialize smsc911x device connected to the GPMC. Note that we
56 * assume that pin multiplexing is done in the board-*.c file, 46 * assume that pin multiplexing is done in the board-*.c file,
@@ -58,6 +48,7 @@ static struct platform_device gpmc_smsc911x_device = {
58 */ 48 */
59void __init gpmc_smsc911x_init(struct omap_smsc911x_platform_data *board_data) 49void __init gpmc_smsc911x_init(struct omap_smsc911x_platform_data *board_data)
60{ 50{
51 struct platform_device *pdev;
61 unsigned long cs_mem_base; 52 unsigned long cs_mem_base;
62 int ret; 53 int ret;
63 54
@@ -97,7 +88,10 @@ void __init gpmc_smsc911x_init(struct omap_smsc911x_platform_data *board_data)
97 if (gpmc_cfg->flags) 88 if (gpmc_cfg->flags)
98 gpmc_smsc911x_config.flags = gpmc_cfg->flags; 89 gpmc_smsc911x_config.flags = gpmc_cfg->flags;
99 90
100 if (platform_device_register(&gpmc_smsc911x_device) < 0) { 91 pdev = platform_device_register_resndata(NULL, "smsc911x", gpmc_cfg->id,
92 gpmc_smsc911x_resources, ARRAY_SIZE(gpmc_smsc911x_resources),
93 &gpmc_smsc911x_config, sizeof(gpmc_smsc911x_config));
94 if (!pdev) {
101 printk(KERN_ERR "Unable to register smsc911x device\n"); 95 printk(KERN_ERR "Unable to register smsc911x device\n");
102 gpio_free(gpmc_cfg->gpio_reset); 96 gpio_free(gpmc_cfg->gpio_reset);
103 goto free2; 97 goto free2;