patch-2.4.0-test2 linux/drivers/net/smc-mca.c

Next file: linux/drivers/net/smc-ultra.c
Previous file: linux/drivers/net/skfp/skfddi.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test1/linux/drivers/net/smc-mca.c linux/drivers/net/smc-mca.c
@@ -118,7 +118,7 @@
 	int irq = dev ? dev->irq : 0;
 
 	if (!MCA_bus) {
-		return ENODEV;
+		return -ENODEV;
 	}
 
 	if (base_addr || irq) {
@@ -252,9 +252,6 @@
 	reg4 = inb(ioaddr + 4) & 0x7f;
 	outb(reg4, ioaddr + 4);
 
-	if (load_8390_module("wd.c"))
-		return -ENOSYS;
-
 	printk(KERN_INFO "%s: Parameters: %#3x,", dev->name, ioaddr);
 
 	for (i = 0; i < 6; i++)
@@ -458,6 +455,9 @@
 {
 	int this_dev, found = 0;
 
+	if (load_8390_module("wd.c"))
+		return -ENOSYS;
+
 	for (this_dev = 0; this_dev < MAX_ULTRAMCA_CARDS; this_dev++) {
 		struct net_device *dev = &dev_ultra[this_dev];
 		dev->irq = irq[this_dev];
@@ -466,15 +466,14 @@
 
 		if (register_netdev(dev) != 0) {
 			if (found != 0) {	/* Got at least one. */
-				lock_8390_module();
 				return 0;
 			}
+			unload_8390_module();
 			printk(KERN_NOTICE "smc-mca.c: No SMC Ultra card found (i/o = 0x%x).\n", io[this_dev]);
 			return -ENXIO;
 		}
 		found++;
 	}
-	lock_8390_module();
 	return 0;
 }
 
@@ -494,7 +493,7 @@
 			kfree(priv);
 		}
 	}
-	unlock_8390_module();
+	unload_8390_module();
 }
 #endif /* MODULE */
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)