patch-2.4.0-test12 linux/drivers/net/ewrk3.c

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

diff -u --recursive --new-file v2.4.0-test11/linux/drivers/net/ewrk3.c linux/drivers/net/ewrk3.c
@@ -350,6 +350,8 @@
 	int tmp = num_ewrk3s, status = -ENODEV;
 	u_long iobase = dev->base_addr;
 
+	SET_MODULE_OWNER(dev);
+
 	if ((iobase == 0) && loading_module) {
 		printk("Autoprobing is not supported when loading a module based driver.\n");
 		status = -EIO;
@@ -681,8 +683,6 @@
 		return -EINVAL;
 	}
 
-	MOD_INC_USE_COUNT;
-
 	return status;
 }
 
@@ -1132,8 +1132,6 @@
 	if (!lp->hard_strapped) {
 		free_irq(dev->irq, dev);
 	}
-	MOD_DEC_USE_COUNT;
-
 	return 0;
 }
 
@@ -1860,15 +1858,7 @@
 }
 
 #ifdef MODULE
-static char devicename[9] =
-{0,};
-static struct net_device thisEthwrk =
-{
-	devicename,		/* device name is inserted by /linux/drivers/net/net_init.c */
-	0, 0, 0, 0,
-	0x300, 5,		/* I/O address, IRQ */
-	0, 0, 0, NULL, ewrk3_probe};
-
+static struct net_device thisEthwrk;
 static int io = 0x300;		/* <--- EDIT THESE LINES FOR YOUR CONFIGURATION */
 static int irq = 5;		/* or use the insmod io= irq= options           */
 
@@ -1879,6 +1869,7 @@
 {
 	thisEthwrk.base_addr = io;
 	thisEthwrk.irq = irq;
+	thisEthwrk.init = ewrk3_probe;
 	if (register_netdev(&thisEthwrk) != 0)
 		return -EIO;
 	return 0;

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