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 / 3c503.c
index 29dfd47..dcc98af 100644 (file)
@@ -148,14 +148,6 @@ el2_pio_probe(struct net_device *dev)
     return -ENODEV;
 }
 
-static void cleanup_card(struct net_device *dev)
-{
-       /* NB: el2_close() handles free_irq */
-       release_region(dev->base_addr, EL2_IO_EXTENT);
-       if (ei_status.mem)
-               iounmap(ei_status.mem);
-}
-
 #ifndef MODULE
 struct net_device * __init el2_probe(int unit)
 {
@@ -171,12 +163,7 @@ struct net_device * __init el2_probe(int unit)
        err = do_el2_probe(dev);
        if (err)
                goto out;
-       err = register_netdev(dev);
-       if (err)
-               goto out1;
        return dev;
-out1:
-       cleanup_card(dev);
 out:
        free_netdev(dev);
        return ERR_PTR(err);
@@ -356,6 +343,10 @@ el2_probe1(struct net_device *dev, int ioaddr)
     dev->poll_controller = ei_poll;
 #endif
 
+    retval = register_netdev(dev);
+    if (retval)
+       goto out1;
+
     if (dev->mem_start)
        printk("%s: %s - %dkB RAM, 8kB shared mem window at %#6lx-%#6lx.\n",
                dev->name, ei_status.name, (wordlength+1)<<3,
@@ -715,11 +706,8 @@ init_module(void)
                dev->base_addr = io[this_dev];
                dev->mem_end = xcvr[this_dev];  /* low 4bits = xcvr sel. */
                if (do_el2_probe(dev) == 0) {
-                       if (register_netdev(dev) == 0) {
-                               dev_el2[found++] = dev;
-                               continue;
-                       }
-                       cleanup_card(dev);
+                       dev_el2[found++] = dev;
+                       continue;
                }
                free_netdev(dev);
                printk(KERN_WARNING "3c503.c: No 3c503 card found (i/o = 0x%x).\n", io[this_dev]);
@@ -730,6 +718,14 @@ init_module(void)
        return -ENXIO;
 }
 
+static void cleanup_card(struct net_device *dev)
+{
+       /* NB: el2_close() handles free_irq */
+       release_region(dev->base_addr, EL2_IO_EXTENT);
+       if (ei_status.mem)
+               iounmap(ei_status.mem);
+}
+
 void
 cleanup_module(void)
 {