Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / drivers / net / eexpress.c
index 24663cb..82bd356 100644 (file)
@@ -7,7 +7,7 @@
  * Support for 8-bit mode by Zoltan Szilagyi <zoltans@cs.arizona.edu>
  *
  * Many modifications, and currently maintained, by
- *  Philip Blundell <Philip.Blundell@pobox.com>
+ *  Philip Blundell <philb@gnu.org>
  * Added the Compaq LTE  Alan Cox <alan@redhat.com>
  * Added MCA support Adam Fritzler <mid@auk.cx>
  *
 #include <linux/slab.h>
 #include <linux/mca-legacy.h>
 #include <linux/spinlock.h>
+#include <linux/bitops.h>
 
 #include <asm/system.h>
-#include <asm/bitops.h>
 #include <asm/io.h>
 #include <asm/irq.h>
 
@@ -230,7 +230,7 @@ static unsigned short start_code[] = {
 /* maps irq number to EtherExpress magic value */
 static char irqrmap[] = { 0,0,1,2,3,4,0,0,0,1,5,6,0,0,0,0 };
 
-#ifdef CONFIG_MCA
+#ifdef CONFIG_MCA_LEGACY
 /* mapping of the first four bits of the second POS register */
 static unsigned short mca_iomap[] = {
        0x270, 0x260, 0x250, 0x240, 0x230, 0x220, 0x210, 0x200,
@@ -345,7 +345,7 @@ static int __init do_express_probe(struct net_device *dev)
 
        dev->if_port = 0xff; /* not set */
 
-#ifdef CONFIG_MCA
+#ifdef CONFIG_MCA_LEGACY
        if (MCA_bus) {
                int slot = 0;
 
@@ -423,6 +423,7 @@ static int __init do_express_probe(struct net_device *dev)
        return -ENODEV;
 }
 
+#ifndef MODULE
 struct net_device * __init express_probe(int unit)
 {
        struct net_device *dev = alloc_etherdev(sizeof(struct net_local));
@@ -435,14 +436,12 @@ struct net_device * __init express_probe(int unit)
        netdev_boot_setup_check(dev);
 
        err = do_express_probe(dev);
-       if (!err) {
-               err = register_netdev(dev);
-               if (!err)
-                       return dev;
-       }
+       if (!err)
+               return dev;
        free_netdev(dev);
        return ERR_PTR(err);
 }
+#endif
 
 /*
  * open and initialize the adapter, ready for use
@@ -1203,7 +1202,8 @@ static int __init eexp_hw_probe(struct net_device *dev, unsigned short ioaddr)
        dev->set_multicast_list = &eexp_set_multicast;
        dev->tx_timeout = eexp_timeout;
        dev->watchdog_timeo = 2*HZ;
-       return 0;
+
+       return register_netdev(dev);
 }
 
 /*
@@ -1689,8 +1689,8 @@ static struct net_device *dev_eexp[EEXP_MAX_CARDS];
 static int irq[EEXP_MAX_CARDS];
 static int io[EEXP_MAX_CARDS];
 
-MODULE_PARM(io, "1-" __MODULE_STRING(EEXP_MAX_CARDS) "i");
-MODULE_PARM(irq, "1-" __MODULE_STRING(EEXP_MAX_CARDS) "i");
+module_param_array(io, int, NULL, 0);
+module_param_array(irq, int, NULL, 0);
 MODULE_PARM_DESC(io, "EtherExpress 16 I/O base address(es)");
 MODULE_PARM_DESC(irq, "EtherExpress 16 IRQ number(s)");
 MODULE_LICENSE("GPL");
@@ -1714,7 +1714,7 @@ int init_module(void)
                                break;
                        printk(KERN_NOTICE "eexpress.c: Module autoprobe not recommended, give io=xx.\n");
                }
-               if (do_express_probe(dev) == 0 && register_netdev(dev) == 0) {
+               if (do_express_probe(dev) == 0) {
                        dev_eexp[this_dev] = dev;
                        found++;
                        continue;