]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/net/ethernet/8390/mac8390.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
[karo-tx-linux.git] / drivers / net / ethernet / 8390 / mac8390.c
index 90e825e8abfee9aeb4d743fab9be26ca7dd109ec..b9283901136e974a9ad4207cae898cb492207700 100644 (file)
@@ -178,10 +178,8 @@ static enum mac8390_type __init mac8390_ident(struct nubus_dev *dev)
                case NUBUS_DRHW_APPLE_SONIC_LC:
                case NUBUS_DRHW_SONNET:
                        return MAC8390_NONE;
-                       break;
                default:
                        return MAC8390_APPLE;
-                       break;
                }
                break;
 
@@ -189,13 +187,10 @@ static enum mac8390_type __init mac8390_ident(struct nubus_dev *dev)
                switch (dev->dr_hw) {
                case NUBUS_DRHW_ASANTE_LC:
                        return MAC8390_NONE;
-                       break;
                case NUBUS_DRHW_CABLETRON:
                        return MAC8390_CABLETRON;
-                       break;
                default:
                        return MAC8390_APPLE;
-                       break;
                }
                break;
 
@@ -220,10 +215,8 @@ static enum mac8390_type __init mac8390_ident(struct nubus_dev *dev)
                switch (dev->dr_hw) {
                case NUBUS_DRHW_INTERLAN:
                        return MAC8390_INTERLAN;
-                       break;
                default:
                        return MAC8390_KINETICS;
-                       break;
                }
                break;
 
@@ -461,34 +454,22 @@ MODULE_AUTHOR("David Huggins-Daines <dhd@debian.org> and others");
 MODULE_DESCRIPTION("Macintosh NS8390-based Nubus Ethernet driver");
 MODULE_LICENSE("GPL");
 
-/* overkill, of course */
-static struct net_device *dev_mac8390[15];
-int init_module(void)
+static struct net_device *dev_mac8390;
+
+int __init init_module(void)
 {
-       int i;
-       for (i = 0; i < 15; i++) {
-               struct net_device *dev = mac8390_probe(-1);
-               if (IS_ERR(dev))
-                       break;
-               dev_mac890[i] = dev;
-       }
-       if (!i) {
-               pr_notice("No useable cards found, driver NOT installed.\n");
-               return -ENODEV;
+       dev_mac8390 = mac8390_probe(-1);
+       if (IS_ERR(dev_mac8390)) {
+               pr_warn("mac8390: No card found\n");
+               return PTR_ERR(dev_mac8390);
        }
        return 0;
 }
 
-void cleanup_module(void)
+void __exit cleanup_module(void)
 {
-       int i;
-       for (i = 0; i < 15; i++) {
-               struct net_device *dev = dev_mac890[i];
-               if (dev) {
-                       unregister_netdev(dev);
-                       free_netdev(dev);
-               }
-       }
+       unregister_netdev(dev_mac8390);
+       free_netdev(dev_mac8390);
 }
 
 #endif /* MODULE */
@@ -563,7 +544,6 @@ static int __init mac8390_initdev(struct net_device *dev,
                case ACCESS_UNKNOWN:
                        pr_err("Don't know how to access card memory!\n");
                        return -ENODEV;
-                       break;
 
                case ACCESS_16:
                        /* 16 bit card, register map is reversed */