diff options
author | Catalin Marinas <catalin.marinas@arm.com> | 2008-12-01 09:54:58 -0500 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2008-12-01 09:54:58 -0500 |
commit | 0a3813306f432e8925ff648c84bd488b840e5185 (patch) | |
tree | 42583fc92c9fc2fc73599a74b80ea1359b9c5f86 /arch/arm/mach-realview/realview_eb.c | |
parent | 1bbdf637baa708a2f0f46ead56c6c618b7dad7a8 (diff) |
RealView: Refactor the Ethernet device registration
This patch moves the Ethernet device registration from individual
realview_*.c files to core.c.
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm/mach-realview/realview_eb.c')
-rw-r--r-- | arch/arm/mach-realview/realview_eb.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/arch/arm/mach-realview/realview_eb.c b/arch/arm/mach-realview/realview_eb.c index 66dc2561c8c7..e9b7b04c2fe6 100644 --- a/arch/arm/mach-realview/realview_eb.c +++ b/arch/arm/mach-realview/realview_eb.c | |||
@@ -242,12 +242,6 @@ static struct resource realview_eb_eth_resources[] = { | |||
242 | }, | 242 | }, |
243 | }; | 243 | }; |
244 | 244 | ||
245 | static struct platform_device realview_eb_eth_device = { | ||
246 | .id = 0, | ||
247 | .num_resources = ARRAY_SIZE(realview_eb_eth_resources), | ||
248 | .resource = realview_eb_eth_resources, | ||
249 | }; | ||
250 | |||
251 | /* | 245 | /* |
252 | * Detect and register the correct Ethernet device. RealView/EB rev D | 246 | * Detect and register the correct Ethernet device. RealView/EB rev D |
253 | * platforms use the newer SMSC LAN9118 Ethernet chip | 247 | * platforms use the newer SMSC LAN9118 Ethernet chip |
@@ -255,21 +249,19 @@ static struct platform_device realview_eb_eth_device = { | |||
255 | static int eth_device_register(void) | 249 | static int eth_device_register(void) |
256 | { | 250 | { |
257 | void __iomem *eth_addr = ioremap(REALVIEW_EB_ETH_BASE, SZ_4K); | 251 | void __iomem *eth_addr = ioremap(REALVIEW_EB_ETH_BASE, SZ_4K); |
252 | const char *name = NULL; | ||
258 | u32 idrev; | 253 | u32 idrev; |
259 | 254 | ||
260 | if (!eth_addr) | 255 | if (!eth_addr) |
261 | return -ENOMEM; | 256 | return -ENOMEM; |
262 | 257 | ||
263 | idrev = readl(eth_addr + 0x50); | 258 | idrev = readl(eth_addr + 0x50); |
264 | if ((idrev & 0xFFFF0000) == 0x01180000) | 259 | if ((idrev & 0xFFFF0000) != 0x01180000) |
265 | /* SMSC LAN9118 chip present */ | 260 | /* SMSC LAN9118 not present, use LAN91C111 instead */ |
266 | realview_eb_eth_device.name = "smc911x"; | 261 | name = "smc91x"; |
267 | else | ||
268 | /* SMSC 91C111 chip present */ | ||
269 | realview_eb_eth_device.name = "smc91x"; | ||
270 | 262 | ||
271 | iounmap(eth_addr); | 263 | iounmap(eth_addr); |
272 | return platform_device_register(&realview_eb_eth_device); | 264 | return realview_eth_register(name, realview_eb_eth_resources); |
273 | } | 265 | } |
274 | 266 | ||
275 | static void __init gic_init_irq(void) | 267 | static void __init gic_init_irq(void) |