ARM: clps711x: Using platform_driver for ethernet device

This patch removes static mappings for ethernet devices. Now we will use
platform_driver for ethernet devices.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Olof Johansson <olof@lixom.net>
diff --git a/arch/arm/mach-clps711x/cdb89712.c b/arch/arm/mach-clps711x/cdb89712.c
index d90d25c..235e625 100644
--- a/arch/arm/mach-clps711x/cdb89712.c
+++ b/arch/arm/mach-clps711x/cdb89712.c
@@ -23,6 +23,8 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/io.h>
+#include <linux/interrupt.h>
+#include <linux/platform_device.h>
 
 #include <mach/hardware.h>
 #include <asm/pgtable.h>
@@ -34,30 +36,26 @@
 
 #include "common.h"
 
-/*
- * Map the CS89712 Ethernet port.  That should be moved to the
- * ethernet driver, perhaps.
- */
-static struct map_desc cdb89712_io_desc[] __initdata = {
-	{
-		.virtual	= IO_ADDRESS(ETHER_PHYS_BASE),
-		.pfn		= __phys_to_pfn(ETHER_PHYS_BASE),
-		.length		= ETHER_SIZE,
-		.type		= MT_DEVICE
-	}
+#define CDB89712_CS8900_BASE	(CS2_PHYS_BASE + 0x300)
+#define CDB89712_CS8900_IRQ	(IRQ_EINT3)
+
+static struct resource cdb89712_cs8900_resource[] __initdata = {
+	DEFINE_RES_MEM(CDB89712_CS8900_BASE, SZ_1K),
+	DEFINE_RES_IRQ(CDB89712_CS8900_IRQ),
 };
 
-static void __init cdb89712_map_io(void)
+static void __init cdb89712_init(void)
 {
-	clps711x_map_io();
-	iotable_init(cdb89712_io_desc, ARRAY_SIZE(cdb89712_io_desc));
+	platform_device_register_simple("cs89x0", 0, cdb89712_cs8900_resource,
+					ARRAY_SIZE(cdb89712_cs8900_resource));
 }
 
 MACHINE_START(CDB89712, "Cirrus-CDB89712")
 	/* Maintainer: Ray Lehtiniemi */
 	.atag_offset	= 0x100,
-	.map_io		= cdb89712_map_io,
+	.map_io		= clps711x_map_io,
 	.init_irq	= clps711x_init_irq,
 	.timer		= &clps711x_timer,
+	.init_machine	= cdb89712_init,
 	.restart	= clps711x_restart,
 MACHINE_END