patch-1.3.39 linux/drivers/net/ibmtr.c

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

diff -u --recursive --new-file v1.3.38/linux/drivers/net/ibmtr.c linux/drivers/net/ibmtr.c
@@ -40,10 +40,7 @@
       active adapter is identified.
 */
 	
-#ifdef MODULE
 #include <linux/module.h>
-#include <linux/version.h>
-#endif
 
 #define NO_AUTODETECT 1
 #undef NO_AUTODETECT
@@ -563,9 +560,7 @@
       /*  NEED to see smem size *AND* reset high 512 bytes if
           needed */
 
-#ifdef MODULE
-	MOD_INC_USE_COUNT;
-#endif
+      MOD_INC_USE_COUNT;
 
       return 0;
    }
@@ -589,11 +584,9 @@
 
 	if(close_adapter->ret_code)
 		DPRINTK("close adapter failed: %02X\n",close_adapter->ret_code);
-
-#ifdef MODULE
-	MOD_DEC_USE_COUNT;
-#endif
 	
+	MOD_DEC_USE_COUNT;
+
 	return 0;
 }
 
@@ -1294,7 +1287,6 @@
 }
 
 #ifdef MODULE
-char kernel_version[] = UTS_RELEASE;
 static char devicename[9] = { 0, };
 static struct device dev_ibmtr = {
 	devicename, /* device name is inserted by linux/drivers/net/net_init.c */
@@ -1302,7 +1294,7 @@
 	0, 0,
 	0, 0, 0, NULL, tok_probe };
 
-int io = 0xa20;
+static int io = 0xa20;
 
 int init_module(void)
 {
@@ -1320,16 +1312,11 @@
 void
 cleanup_module(void)
 {
-	if (MOD_IN_USE)
-		printk("ibmtr: device busy, remove delayed\n");
-	else
-	{
-		unregister_netdev(&dev_ibmtr);
-
-		/* If we don't do this, we can't re-insmod it later. */
-		free_irq(dev_ibmtr.irq);
-		irq2dev_map[dev_ibmtr.irq] = NULL;
-		release_region(dev_ibmtr.base_addr, TR_IO_EXTENT);
-	}
+	unregister_netdev(&dev_ibmtr);
+
+	/* If we don't do this, we can't re-insmod it later. */
+	free_irq(dev_ibmtr.irq);
+	irq2dev_map[dev_ibmtr.irq] = NULL;
+	release_region(dev_ibmtr.base_addr, TR_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