patch-2.4.0-test11 linux/drivers/net/3c507.c

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

diff -u --recursive --new-file v2.4.0-test10/linux/drivers/net/3c507.c linux/drivers/net/3c507.c
@@ -304,9 +304,11 @@
 
 int __init el16_probe(struct net_device *dev)
 {
-	int base_addr = dev ? dev->base_addr : 0;
+	int base_addr = dev->base_addr;
 	int i;
 
+	SET_MODULE_OWNER(dev);
+
 	if (base_addr > 0x1ff)	/* Check a single specified location. */
 		return el16_probe1(dev, base_addr);
 	else if (base_addr != 0)
@@ -339,7 +341,7 @@
 		init_ID_done = 1;
 	}
 
-	if (!request_region(ioaddr, EL16_IO_EXTENT, "3c507"))
+	if (!request_region(ioaddr, EL16_IO_EXTENT, dev->name))
 		return -ENODEV;
 
 	if ((inb(ioaddr) != '*') || (inb(ioaddr + 1) != '3') || 
@@ -358,7 +360,7 @@
 
 	irq = inb(ioaddr + IRQ_CONFIG) & 0x0f;
 
-	irqval = request_irq(irq, &el16_interrupt, 0, "3c507", dev);
+	irqval = request_irq(irq, &el16_interrupt, 0, dev->name, dev);
 	if (irqval) {
 		printk ("unable to get IRQ %d (irqval=%d).\n", irq, irqval);
 		retval = -EAGAIN;
@@ -439,9 +441,6 @@
 	init_82586_mem(dev);
 
 	netif_start_queue(dev);
-
-	MOD_INC_USE_COUNT;
-
 	return 0;
 }
 
@@ -624,8 +623,6 @@
 
 	/* Update the statistics here. */
 
-	MOD_DEC_USE_COUNT;
-
 	return 0;
 }
 
@@ -857,8 +854,7 @@
 	lp->rx_tail = rx_tail;
 }
 #ifdef MODULE
-static struct net_device dev_3c507 = { init: el16_probe };
-
+static struct net_device dev_3c507;
 static int io = 0x300;
 static int irq = 0;
 MODULE_PARM(io, "i");
@@ -870,6 +866,7 @@
 		printk("3c507: You should not use auto-probing with insmod!\n");
 	dev_3c507.base_addr = io;
 	dev_3c507.irq       = irq;
+	dev_3c507.init	    = el16_probe;
 	if (register_netdev(&dev_3c507) != 0) {
 		printk("3c507: register_netdev() returned non-zero.\n");
 		return -EIO;

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