summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-realview/realview_eb.c
diff options
context:
space:
mode:
authorCatalin Marinas <catalin.marinas@arm.com>2008-12-01 14:54:58 +0000
committerCatalin Marinas <catalin.marinas@arm.com>2008-12-01 14:54:58 +0000
commit0a3813306f432e8925ff648c84bd488b840e5185 (patch)
tree42583fc92c9fc2fc73599a74b80ea1359b9c5f86 /arch/arm/mach-realview/realview_eb.c
parent1bbdf637baa708a2f0f46ead56c6c618b7dad7a8 (diff)
downloadblackbird-op-linux-0a3813306f432e8925ff648c84bd488b840e5185.tar.gz
blackbird-op-linux-0a3813306f432e8925ff648c84bd488b840e5185.zip
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.c18
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[] = {
},
};
-static struct platform_device realview_eb_eth_device = {
- .id = 0,
- .num_resources = ARRAY_SIZE(realview_eb_eth_resources),
- .resource = realview_eb_eth_resources,
-};
-
/*
* Detect and register the correct Ethernet device. RealView/EB rev D
* platforms use the newer SMSC LAN9118 Ethernet chip
@@ -255,21 +249,19 @@ static struct platform_device realview_eb_eth_device = {
static int eth_device_register(void)
{
void __iomem *eth_addr = ioremap(REALVIEW_EB_ETH_BASE, SZ_4K);
+ const char *name = NULL;
u32 idrev;
if (!eth_addr)
return -ENOMEM;
idrev = readl(eth_addr + 0x50);
- if ((idrev & 0xFFFF0000) == 0x01180000)
- /* SMSC LAN9118 chip present */
- realview_eb_eth_device.name = "smc911x";
- else
- /* SMSC 91C111 chip present */
- realview_eb_eth_device.name = "smc91x";
+ if ((idrev & 0xFFFF0000) != 0x01180000)
+ /* SMSC LAN9118 not present, use LAN91C111 instead */
+ name = "smc91x";
iounmap(eth_addr);
- return platform_device_register(&realview_eb_eth_device);
+ return realview_eth_register(name, realview_eb_eth_resources);
}
static void __init gic_init_irq(void)
OpenPOWER on IntegriCloud