patch-1.3.19 linux/drivers/net/3c505.c

Next file: linux/drivers/net/3c505.h
Previous file: linux/drivers/net/3c503.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.18/linux/drivers/net/3c505.c linux/drivers/net/3c505.c
@@ -1449,7 +1449,7 @@
 	/*
 	 * and reserve the address region
 	 */
-	request_region(dev->base_addr,16,"3c505");
+	request_region(dev->base_addr, ELP_IO_EXTENT, "3c505");
 
 	/*
 	 * initialise the device
@@ -1459,8 +1459,12 @@
 }
 #ifdef MODULE
 char kernel_version[] = UTS_RELEASE;
+static char devicename[9] = { 0, };
 static struct device dev_3c505 = {
-	"        " /*"3c505"*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, elplus_probe };
+	devicename, /* device name is inserted by linux/drivers/net/net_init.c */
+	0, 0, 0, 0,
+	0, 0,
+	0, 0, 0, NULL, elplus_probe };
 
 int io = 0x300;
 int irq = 0;
@@ -1468,7 +1472,7 @@
 int init_module(void)
 {
 	if (io == 0)
-	  printk("3c505: You should not use auto-probing with insmod!\n");
+		printk("3c505: You should not use auto-probing with insmod!\n");
 	dev_3c505.base_addr = io;
 	dev_3c505.irq       = irq;
 	if (register_netdev(&dev_3c505) != 0) {
@@ -1486,6 +1490,9 @@
 	else
 	{
 		unregister_netdev(&dev_3c505);
+
+		/* If we don't do this, we can't re-insmod it later. */
+		release_region(dev_3c505.base_addr, ELP_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