patch-1.3.39 linux/drivers/net/3c509.c

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

diff -u --recursive --new-file v1.3.38/linux/drivers/net/3c509.c linux/drivers/net/3c509.c
@@ -26,12 +26,9 @@
 
 static const  char *version = "3c509.c:1.03 10/8/94 becker@cesdis.gsfc.nasa.gov\n";
 
-#include <linux/config.h>
-#ifdef MODULE
 #include <linux/module.h>
-#include <linux/version.h>
-#endif
 
+#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/string.h>
@@ -41,12 +38,13 @@
 #include <linux/in.h>
 #include <linux/malloc.h>
 #include <linux/ioport.h>
-#include <asm/bitops.h>
-#include <asm/io.h>
-
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
 #include <linux/skbuff.h>
+#include <linux/config.h>	/* for CONFIG_MCA */
+
+#include <asm/bitops.h>
+#include <asm/io.h>
 
 
 #ifdef EL3_DEBUG
@@ -380,9 +378,7 @@
 		printk("%s: Opened 3c509  IRQ %d  status %4.4x.\n",
 			   dev->name, dev->irq, inw(ioaddr + EL3_STATUS));
 
-#ifdef MODULE
 	MOD_INC_USE_COUNT;
-#endif
 	return 0;					/* Always succeed */
 }
 
@@ -699,14 +695,11 @@
 	irq2dev_map[dev->irq] = 0;
 
 	update_stats(ioaddr, dev);
-#ifdef MODULE
 	MOD_DEC_USE_COUNT;
-#endif
 	return 0;
 }
 
 #ifdef MODULE
-char kernel_version[] = UTS_RELEASE;
 static char devicename[9] = { 0, };
 static struct device dev_3c509 = {
 	devicename, /* device name is inserted by linux/drivers/net/net_init.c */
@@ -714,8 +707,8 @@
 	0, 0,
 	0, 0, 0, NULL, el3_probe };
 
-int io = 0;
-int irq = 0;
+static int io = 0;
+static int irq = 0;
 
 int
 init_module(void)
@@ -733,16 +726,11 @@
 void
 cleanup_module(void)
 {
-	if (MOD_IN_USE)
-		printk("3c509: device busy, remove delayed\n");
-	else
-	{
-		unregister_netdev(&dev_3c509);
-		kfree_s(dev_3c509.priv,sizeof(struct el3_private));
-		dev_3c509.priv=NULL;
-		/* If we don't do this, we can't re-insmod it later. */
-		release_region(dev_3c509.base_addr, EL3_IO_EXTENT);
-	}
+	unregister_netdev(&dev_3c509);
+	kfree_s(dev_3c509.priv,sizeof(struct el3_private));
+	dev_3c509.priv=NULL;
+	/* If we don't do this, we can't re-insmod it later. */
+	release_region(dev_3c509.base_addr, EL3_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