patch-2.4.3 linux/drivers/net/82596.c

Next file: linux/drivers/net/Config.in
Previous file: linux/drivers/net/8139too.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.2/linux/drivers/net/82596.c linux/drivers/net/82596.c
@@ -40,8 +40,6 @@
 
  */
 
-static const char *version = "82596.c $Revision: 1.4 $\n";
-
 #include <linux/config.h>
 #include <linux/module.h>
 
@@ -65,6 +63,9 @@
 #include <asm/pgtable.h>
 #include <asm/pgalloc.h>
 
+static char version[] __initdata =
+	"82596.c $Revision: 1.4 $\n";
+
 /* DEBUG flags
  */
 
@@ -333,7 +334,7 @@
 	spinlock_t lock;
 };
 
-char init_setup[] =
+static char init_setup[] =
 {
 	0x8E,			/* length, prefetch on */
 	0xC8,			/* fifo to 8, monitor off */
@@ -1132,9 +1133,9 @@
 		/* this is easy the ethernet interface can only be at 0x300 */
 		/* first check nothing is already registered here */
 
-		if (check_region(ioaddr, I596_TOTAL_SIZE)) {
+		if (!request_region(ioaddr, I596_TOTAL_SIZE, dev->name)) {
 			printk("82596: IO address 0x%04x in use\n", ioaddr);
-			return -ENODEV;
+			return -EBUSY;
 		}
 
 		for (i = 0; i < 8; i++) {
@@ -1144,19 +1145,15 @@
 
 		/* checksum is a multiple of 0x100, got this wrong first time
 		   some machines have 0x100, some 0x200. The DOS driver doesn't
-		   even bother with the checksum */
-
-		if (checksum % 0x100)
-			return -ENODEV;
-
-		/* Some other boards trip the checksum.. but then appear as
-		 * ether address 0. Trap these - AC */
-
-		if (memcmp(eth_addr, "\x00\x00\x49", 3) != 0)
-			return -ENODEV;
-
-		if (!request_region(ioaddr, I596_TOTAL_SIZE, "i596"))
+		   even bother with the checksum.
+		   Some other boards trip the checksum.. but then appear as
+		   ether address 0. Trap these - AC */
+
+		if ((checksum % 0x100) || 
+		    (memcmp(eth_addr, "\x00\x00\x49", 3) != 0)) {
+			release_region(ioaddr, I596_TOTAL_SIZE);
 			return -ENODEV;
+		}
 
 		dev->base_addr = ioaddr;
 		dev->irq = 10;

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