patch-1.3.19 linux/drivers/net/eepro.c

Next file: linux/drivers/net/eexpress.c
Previous file: linux/drivers/net/e2100.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.18/linux/drivers/net/eepro.c linux/drivers/net/eepro.c
@@ -404,7 +404,7 @@
 				printk(version);
 
 			/* Grab the region so we can find another board if autoIRQ fails. */
-			request_region(ioaddr, EEPRO_IO_EXTENT,"eepro");
+			request_region(ioaddr, EEPRO_IO_EXTENT, "eepro");
 
 			/* Initialize the device structure */
 			if (dev->priv == NULL)
@@ -756,9 +756,6 @@
 
 	irq2dev_map[dev->irq] = 0;
 
-	/* release the ioport-region */
-	release_region(ioaddr, 16);
-
 	/* Update the statistics here. What statistics? */
 
 	/* We are supposed to wait for 200 us after a RESET */
@@ -1133,8 +1130,12 @@
 
 #ifdef MODULE
 char kernel_version[] = UTS_RELEASE;
+static char devicename[9] = { 0, };
 static struct device dev_eepro = {
-	"        " /*"eepro"*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, eepro_probe };
+	devicename, /* device name is inserted by linux/drivers/net/net_init.c */
+	0, 0, 0, 0,
+	0, 0,
+	0, 0, 0, NULL, eepro_probe };
 
 int io = 0x200;
 int irq = 0;
@@ -1143,7 +1144,7 @@
 init_module(void)
 {
 	if (io == 0)
-	  printk("eepro: You should not use auto-probing with insmod!\n");
+		printk("eepro: You should not use auto-probing with insmod!\n");
 	dev_eepro.base_addr = io;
 	dev_eepro.irq       = irq;
 
@@ -1162,6 +1163,9 @@
 		unregister_netdev(&dev_eepro);
 		kfree_s(dev_eepro.priv,sizeof(struct eepro_local));
 		dev_eepro.priv=NULL;
+
+		/* If we don't do this, we can't re-insmod it later. */
+		release_region(dev_eepro.base_addr, EEPRO_IO_EXTENT);
 	}
 }
 #endif /* MODULE */

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this