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 / es3210.c
index f1e8150..6b0ab1e 100644 (file)
@@ -155,13 +155,6 @@ static int __init do_es_probe(struct net_device *dev)
        return -ENODEV;
 }
 
-static void cleanup_card(struct net_device *dev)
-{
-       free_irq(dev->irq, dev);
-       release_region(dev->base_addr, ES_IO_EXTENT);
-       iounmap(ei_status.mem);
-}
-
 #ifndef MODULE
 struct net_device * __init es_probe(int unit)
 {
@@ -177,12 +170,7 @@ struct net_device * __init es_probe(int unit)
        err = do_es_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);
@@ -310,6 +298,10 @@ static int __init es_probe1(struct net_device *dev, int ioaddr)
        dev->poll_controller = ei_poll;
 #endif
        NS8390_init(dev, 0);
+
+       retval = register_netdev(dev);
+       if (retval)
+               goto out1;
        return 0;
 out1:
        free_irq(dev->irq, dev);
@@ -445,11 +437,8 @@ init_module(void)
                dev->base_addr = io[this_dev];
                dev->mem_start = mem[this_dev];
                if (do_es_probe(dev) == 0) {
-                       if (register_netdev(dev) == 0) {
-                               dev_es3210[found++] = dev;
-                               continue;
-                       }
-                       cleanup_card(dev);
+                       dev_es3210[found++] = dev;
+                       continue;
                }
                free_netdev(dev);
                printk(KERN_WARNING "es3210.c: No es3210 card found (i/o = 0x%x).\n", io[this_dev]);
@@ -460,6 +449,13 @@ init_module(void)
        return -ENXIO;
 }
 
+static void cleanup_card(struct net_device *dev)
+{
+       free_irq(dev->irq, dev);
+       release_region(dev->base_addr, ES_IO_EXTENT);
+       iounmap(ei_status.mem);
+}
+
 void
 cleanup_module(void)
 {