]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
ne: MIPS: Use platform_driver for ne on RBTX49XX
authorAtsushi Nemoto <anemo@mba.ocn.ne.jp>
Mon, 30 Apr 2007 15:27:58 +0000 (00:27 +0900)
committerJeff Garzik <jeff@garzik.org>
Tue, 8 May 2007 05:23:09 +0000 (01:23 -0400)
This patch lets RBTX49XX boards use generic platform_driver interface
for the ne driver.

* Use platform_device to pass ioaddr and irq to the ne driver.
* Remove unnecessary ifdefs for RBTX49XX from the ne driver.
* Make the ne driver selectable on these boards regardless of CONFIG_ISA

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c
arch/mips/tx4938/toshiba_rbtx4938/setup.c
drivers/net/Kconfig
drivers/net/ne.c

index 0f7576dfd1413ad46363b8eaa52e3c89bcf8ec62..a0c11efeaeeb9dd24658c114b5c46fa66bf26e70 100644 (file)
@@ -1049,3 +1049,22 @@ static int __init toshiba_rbtx4927_rtc_init(void)
        return IS_ERR(dev) ? PTR_ERR(dev) : 0;
 }
 device_initcall(toshiba_rbtx4927_rtc_init);
+
+static int __init rbtx4927_ne_init(void)
+{
+       static struct resource __initdata res[] = {
+               {
+                       .start  = RBTX4927_RTL_8019_BASE,
+                       .end    = RBTX4927_RTL_8019_BASE + 0x20 - 1,
+                       .flags  = IORESOURCE_IO,
+               }, {
+                       .start  = RBTX4927_RTL_8019_IRQ,
+                       .flags  = IORESOURCE_IRQ,
+               }
+       };
+       struct platform_device *dev =
+               platform_device_register_simple("ne", -1,
+                                               res, ARRAY_SIZE(res));
+       return IS_ERR(dev) ? PTR_ERR(dev) : 0;
+}
+device_initcall(rbtx4927_ne_init);
index 66163ba452c809b31a25338271a1bbed15cd4f30..f5d1ce739fcc48b6eb1442e1cf87f610a7655066 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/console.h>
 #include <linux/pci.h>
 #include <linux/pm.h>
+#include <linux/platform_device.h>
 
 #include <asm/wbflush.h>
 #include <asm/reboot.h>
@@ -1037,3 +1038,22 @@ static int __init tx4938_spi_proc_setup(void)
 
 __initcall(tx4938_spi_proc_setup);
 #endif
+
+static int __init rbtx4938_ne_init(void)
+{
+       struct resource res[] = {
+               {
+                       .start  = RBTX4938_RTL_8019_BASE,
+                       .end    = RBTX4938_RTL_8019_BASE + 0x20 - 1,
+                       .flags  = IORESOURCE_IO,
+               }, {
+                       .start  = RBTX4938_RTL_8019_IRQ,
+                       .flags  = IORESOURCE_IRQ,
+               }
+       };
+       struct platform_device *dev =
+               platform_device_register_simple("ne", -1,
+                                               res, ARRAY_SIZE(res));
+       return IS_ERR(dev) ? PTR_ERR(dev) : 0;
+}
+device_initcall(rbtx4938_ne_init);
index 279ec625cec45ac3d5678d9b2b7009d397b4bd4a..372f25716b5b78e8cd7e84171cd97f4b89a2afb3 100644 (file)
@@ -1104,7 +1104,7 @@ config ETH16I
 
 config NE2000
        tristate "NE2000/NE1000 support"
-       depends on NET_ISA || (Q40 && m) || M32R
+       depends on NET_ISA || (Q40 && m) || M32R || TOSHIBA_RBTX4927 || TOSHIBA_RBTX4938
        select CRC32
        ---help---
          If you have a network (Ethernet) card of this type, say Y and read
index 22d6fe45375e905f394d54860f00c2f650c65392..c9f74bf5f4917634ff9d563bba0a0b2fc4d4df69 100644 (file)
@@ -56,10 +56,6 @@ static const char version2[] =
 #include <asm/system.h>
 #include <asm/io.h>
 
-#if defined(CONFIG_TOSHIBA_RBTX4927) || defined(CONFIG_TOSHIBA_RBTX4938)
-#include <asm/tx4938/rbtx4938.h>
-#endif
-
 #include "8390.h"
 
 #define DRV_NAME "ne"
@@ -232,10 +228,6 @@ struct net_device * __init ne_probe(int unit)
        sprintf(dev->name, "eth%d", unit);
        netdev_boot_setup_check(dev);
 
-#ifdef CONFIG_TOSHIBA_RBTX4938
-       dev->base_addr = RBTX4938_RTL_8019_BASE;
-       dev->irq = RBTX4938_RTL_8019_IRQ;
-#endif
        err = do_ne_probe(dev);
        if (err)
                goto out;