diff options
author | Atsushi Nemoto <anemo@mba.ocn.ne.jp> | 2007-04-30 11:27:58 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-05-08 01:23:09 -0400 |
commit | 57e386ce9d136261bc60a5223f39b179a3c11046 (patch) | |
tree | ec7c47c0bbe8e60b589dc5055732f1d097202cdd | |
parent | 1c08bf10658921dafae8d66be0effc915a209ab0 (diff) |
ne: MIPS: Use platform_driver for ne on RBTX49XX
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>
-rw-r--r-- | arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c | 19 | ||||
-rw-r--r-- | arch/mips/tx4938/toshiba_rbtx4938/setup.c | 20 | ||||
-rw-r--r-- | drivers/net/Kconfig | 2 | ||||
-rw-r--r-- | drivers/net/ne.c | 8 |
4 files changed, 40 insertions, 9 deletions
diff --git a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c index 0f7576dfd141..a0c11efeaeeb 100644 --- a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c +++ b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c | |||
@@ -1049,3 +1049,22 @@ static int __init toshiba_rbtx4927_rtc_init(void) | |||
1049 | return IS_ERR(dev) ? PTR_ERR(dev) : 0; | 1049 | return IS_ERR(dev) ? PTR_ERR(dev) : 0; |
1050 | } | 1050 | } |
1051 | device_initcall(toshiba_rbtx4927_rtc_init); | 1051 | device_initcall(toshiba_rbtx4927_rtc_init); |
1052 | |||
1053 | static int __init rbtx4927_ne_init(void) | ||
1054 | { | ||
1055 | static struct resource __initdata res[] = { | ||
1056 | { | ||
1057 | .start = RBTX4927_RTL_8019_BASE, | ||
1058 | .end = RBTX4927_RTL_8019_BASE + 0x20 - 1, | ||
1059 | .flags = IORESOURCE_IO, | ||
1060 | }, { | ||
1061 | .start = RBTX4927_RTL_8019_IRQ, | ||
1062 | .flags = IORESOURCE_IRQ, | ||
1063 | } | ||
1064 | }; | ||
1065 | struct platform_device *dev = | ||
1066 | platform_device_register_simple("ne", -1, | ||
1067 | res, ARRAY_SIZE(res)); | ||
1068 | return IS_ERR(dev) ? PTR_ERR(dev) : 0; | ||
1069 | } | ||
1070 | device_initcall(rbtx4927_ne_init); | ||
diff --git a/arch/mips/tx4938/toshiba_rbtx4938/setup.c b/arch/mips/tx4938/toshiba_rbtx4938/setup.c index 66163ba452c8..f5d1ce739fcc 100644 --- a/arch/mips/tx4938/toshiba_rbtx4938/setup.c +++ b/arch/mips/tx4938/toshiba_rbtx4938/setup.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/console.h> | 20 | #include <linux/console.h> |
21 | #include <linux/pci.h> | 21 | #include <linux/pci.h> |
22 | #include <linux/pm.h> | 22 | #include <linux/pm.h> |
23 | #include <linux/platform_device.h> | ||
23 | 24 | ||
24 | #include <asm/wbflush.h> | 25 | #include <asm/wbflush.h> |
25 | #include <asm/reboot.h> | 26 | #include <asm/reboot.h> |
@@ -1037,3 +1038,22 @@ static int __init tx4938_spi_proc_setup(void) | |||
1037 | 1038 | ||
1038 | __initcall(tx4938_spi_proc_setup); | 1039 | __initcall(tx4938_spi_proc_setup); |
1039 | #endif | 1040 | #endif |
1041 | |||
1042 | static int __init rbtx4938_ne_init(void) | ||
1043 | { | ||
1044 | struct resource res[] = { | ||
1045 | { | ||
1046 | .start = RBTX4938_RTL_8019_BASE, | ||
1047 | .end = RBTX4938_RTL_8019_BASE + 0x20 - 1, | ||
1048 | .flags = IORESOURCE_IO, | ||
1049 | }, { | ||
1050 | .start = RBTX4938_RTL_8019_IRQ, | ||
1051 | .flags = IORESOURCE_IRQ, | ||
1052 | } | ||
1053 | }; | ||
1054 | struct platform_device *dev = | ||
1055 | platform_device_register_simple("ne", -1, | ||
1056 | res, ARRAY_SIZE(res)); | ||
1057 | return IS_ERR(dev) ? PTR_ERR(dev) : 0; | ||
1058 | } | ||
1059 | device_initcall(rbtx4938_ne_init); | ||
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index 279ec625cec4..372f25716b5b 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig | |||
@@ -1104,7 +1104,7 @@ config ETH16I | |||
1104 | 1104 | ||
1105 | config NE2000 | 1105 | config NE2000 |
1106 | tristate "NE2000/NE1000 support" | 1106 | tristate "NE2000/NE1000 support" |
1107 | depends on NET_ISA || (Q40 && m) || M32R | 1107 | depends on NET_ISA || (Q40 && m) || M32R || TOSHIBA_RBTX4927 || TOSHIBA_RBTX4938 |
1108 | select CRC32 | 1108 | select CRC32 |
1109 | ---help--- | 1109 | ---help--- |
1110 | If you have a network (Ethernet) card of this type, say Y and read | 1110 | If you have a network (Ethernet) card of this type, say Y and read |
diff --git a/drivers/net/ne.c b/drivers/net/ne.c index 22d6fe45375e..c9f74bf5f491 100644 --- a/drivers/net/ne.c +++ b/drivers/net/ne.c | |||
@@ -56,10 +56,6 @@ static const char version2[] = | |||
56 | #include <asm/system.h> | 56 | #include <asm/system.h> |
57 | #include <asm/io.h> | 57 | #include <asm/io.h> |
58 | 58 | ||
59 | #if defined(CONFIG_TOSHIBA_RBTX4927) || defined(CONFIG_TOSHIBA_RBTX4938) | ||
60 | #include <asm/tx4938/rbtx4938.h> | ||
61 | #endif | ||
62 | |||
63 | #include "8390.h" | 59 | #include "8390.h" |
64 | 60 | ||
65 | #define DRV_NAME "ne" | 61 | #define DRV_NAME "ne" |
@@ -232,10 +228,6 @@ struct net_device * __init ne_probe(int unit) | |||
232 | sprintf(dev->name, "eth%d", unit); | 228 | sprintf(dev->name, "eth%d", unit); |
233 | netdev_boot_setup_check(dev); | 229 | netdev_boot_setup_check(dev); |
234 | 230 | ||
235 | #ifdef CONFIG_TOSHIBA_RBTX4938 | ||
236 | dev->base_addr = RBTX4938_RTL_8019_BASE; | ||
237 | dev->irq = RBTX4938_RTL_8019_IRQ; | ||
238 | #endif | ||
239 | err = do_ne_probe(dev); | 231 | err = do_ne_probe(dev); |
240 | if (err) | 232 | if (err) |
241 | goto out; | 233 | goto out; |