patch-2.4.0-test2 linux/drivers/net/apne.c

Next file: linux/drivers/net/appletalk/ltpc.c
Previous file: linux/drivers/net/am79c961a.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test1/linux/drivers/net/apne.c linux/drivers/net/apne.c
@@ -178,9 +178,6 @@
                 8,   9+GAYLE_ODD, 0xa, 0xb+GAYLE_ODD,
               0xc, 0xd+GAYLE_ODD, 0xe, 0xf+GAYLE_ODD };
 
-    if (load_8390_module("apne.c"))
-        return -ENOSYS;
-
     /* We should have a "dev" from Space.c or the static module table. */
     if (dev == NULL) {
 	printk(KERN_ERR "apne.c: Passed a NULL device.\n");
@@ -271,7 +268,7 @@
 	stop_page = (wordlength == 2) ? 0x40 : 0x20;
     } else {
 	printk(" not found.\n");
-	return ENXIO;
+	return -ENXIO;
 
     }
 
@@ -572,12 +569,16 @@
 int init_module(void)
 {
 	int err;
+
+	if (load_8390_module("apne.c"))
+		return -ENOSYS;
+
 	if ((err = register_netdev(&apne_dev))) {
 		if (err == -EIO)
 			printk("No PCMCIA NEx000 ethernet card found.\n");
+		unload_8390_module();
 		return (err);
 	}
-	lock_8390_module();
 	return (0);
 }
 
@@ -591,7 +592,7 @@
 
 	pcmcia_reset();
 
-	unlock_8390_module();
+	unload_8390_module();
 
 	apne_owned = 0;
 }

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