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

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

diff -u --recursive --new-file v2.4.0-test10/linux/drivers/net/3c527.c linux/drivers/net/3c527.c
@@ -184,6 +184,8 @@
 	int i;
 	int adapter_found = 0;
 
+	SET_MODULE_OWNER(dev);
+
 	/* Do not check any supplied i/o locations. 
 	   POS registers usually don't fail :) */
 
@@ -347,25 +349,22 @@
 	 *	Grab the IRQ
 	 */
 
-	if(request_irq(dev->irq, &mc32_interrupt, 0, cardname, dev))
-	{
-		printk("%s: unable to get IRQ %d.\n",
-				   dev->name, dev->irq);
-		return -EAGAIN;
+	i = request_irq(dev->irq, &mc32_interrupt, 0, dev->name, dev);
+	if (i) {
+		printk("%s: unable to get IRQ %d.\n", dev->name, dev->irq);
+		return i;
 	}
 
 	/* Initialize the device structure. */
-	if (dev->priv == NULL) {
-		dev->priv = kmalloc(sizeof(struct mc32_local), GFP_KERNEL);
-		if (dev->priv == NULL)
-		{
-			free_irq(dev->irq, dev);
-			return -ENOMEM;
-		}
+	dev->priv = kmalloc(sizeof(struct mc32_local), GFP_KERNEL);
+	if (dev->priv == NULL)
+	{
+		free_irq(dev->irq, dev);
+		return -ENOMEM;
 	}
 
 	memset(dev->priv, 0, sizeof(struct mc32_local));
-	lp = (struct mc32_local *)dev->priv;
+	lp = dev->priv;
 	lp->slot = slot;
 
 	i=0;
@@ -897,8 +896,6 @@
 	mc32_tx_begin(dev);
 
 	netif_start_queue(dev);	
-	MOD_INC_USE_COUNT;
-
 	return 0;
 }
 
@@ -1318,8 +1315,6 @@
 	
 	/* Update the statistics here. */
 
-	MOD_DEC_USE_COUNT;
-
 	return 0;
 
 }
@@ -1444,7 +1439,7 @@
 
 #ifdef MODULE
 
-static struct net_device this_device = { init: mc32_probe };
+static struct net_device this_device;
 
 
 /**
@@ -1459,6 +1454,7 @@
 {
 	int result;
 
+	this_device.init = mc32_probe;
 	if ((result = register_netdev(&this_device)) != 0)
 		return result;
 

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