]> git.neil.brown.name Git - history.git/commitdiff
[WANROUTER]: Kill MODULE ifdefs.
authorAlexander Viro <viro@parcelfarce.linux.theplanet.co.uk>
Tue, 24 Feb 2004 16:12:28 +0000 (08:12 -0800)
committerPatrick McHardy <kaber@trash.net>
Tue, 24 Feb 2004 16:12:28 +0000 (08:12 -0800)
drivers/net/wan/sdladrv.c
drivers/net/wan/sdlamain.c
net/socket.c
net/wanrouter/wanmain.c

index 76ff1e69dbd795976e259807fcea3c324839ad31..501e9a7520b9f5f87da0df72d07b79228d041a26 100644 (file)
@@ -320,7 +320,7 @@ static int pci_slot_ar[MAX_S514_CARDS];
  * Context:    process
  */
 
-int sdladrv_init(void)
+static int __init sdladrv_init(void)
 {
        int i=0;
 
@@ -340,18 +340,16 @@ int sdladrv_init(void)
        return 0;
 }
 
-#ifdef MODULE
 /*============================================================================
  * Module 'remove' entry point.
  * o release all remaining system resources
  */
-static void sdladrv_cleanup(void)
+static void __exit sdladrv_cleanup(void)
 {
 }
 
 module_init(sdladrv_init);
 module_exit(sdladrv_cleanup);
-#endif
 
 /******* Kernel APIs ********************************************************/
 
index 8769cc97275d2265c07d66fa991b3884dfe0e40b..6c95d5f4005f398c769bf393e00d6a0a8e793f43 100644 (file)
@@ -50,6 +50,7 @@
 #include <linux/stddef.h>      /* offsetof(), etc. */
 #include <linux/errno.h>       /* return codes */
 #include <linux/string.h>      /* inline memset(), etc. */
+#include <linux/init.h>
 #include <linux/slab.h>        /* kmalloc(), kfree() */
 #include <linux/kernel.h>      /* printk(), and other useful stuff */
 #include <linux/module.h>      /* support for loadable modules */
@@ -232,7 +233,7 @@ static int wanpipe_bh_critical;
  * Context:    process
  */
  
-int wanpipe_init(void)
+static int __init wanpipe_init(void)
 {
        int cnt, err = 0;
 
@@ -297,13 +298,12 @@ int wanpipe_init(void)
        return err;
 }
 
-#ifdef MODULE
 /*============================================================================
  * Module 'remove' entry point.
  * o unregister all adapters from the WAN router
  * o release all remaining system resources
  */
-static void wanpipe_cleanup(void)
+static void __exit wanpipe_cleanup(void)
 {
        int i;
 
@@ -322,7 +322,6 @@ static void wanpipe_cleanup(void)
 
 module_init(wanpipe_init);
 module_exit(wanpipe_cleanup);
-#endif
 
 /******* WAN Device Driver Entry Points *************************************/
 
index 6f4d50bfd81871297ceb8b6468323c5d39fa716f..d0219d5a9d43fbe1dc8dcf761f845f8ddab57a9d 100644 (file)
@@ -1927,10 +1927,6 @@ int sock_unregister(int family)
 
 extern void sk_init(void);
 
-#ifdef CONFIG_WAN_ROUTER
-extern void wanrouter_init(void);
-#endif
-
 void __init sock_init(void)
 {
        int i;
@@ -1955,14 +1951,6 @@ void __init sock_init(void)
        skb_init();
 #endif
 
-       /*
-        *      Wan router layer. 
-        */
-
-#ifdef CONFIG_WAN_ROUTER        
-       wanrouter_init();
-#endif
-
        /*
         *      Initialize the protocols module. 
         */
index f0d4451518d622bd032a15a16cca28f74295e67d..3e45d5e4bb21b02b695343d0644b5a861d4cc0cb 100644 (file)
@@ -46,6 +46,7 @@
 #include <linux/stddef.h>      /* offsetof(), etc. */
 #include <linux/errno.h>       /* return codes */
 #include <linux/kernel.h>
+#include <linux/init.h>
 #include <linux/module.h>      /* support for loadable modules */
 #include <linux/slab.h>        /* kmalloc(), kfree() */
 #include <linux/mm.h>          /* verify_area(), etc. */
@@ -164,13 +165,9 @@ static unsigned char wanrouter_oui_ether[] = { 0x00, 0x00, 0x00 };
 static unsigned char wanrouter_oui_802_2[] = { 0x00, 0x80, 0xC2 };
 #endif
 
-#ifndef MODULE
-
-int wanrouter_init(void)
+static int __init wanrouter_init(void)
 {
        int err;
-       extern int wanpipe_init(void);
-       extern int sdladrv_init(void);
 
        printk(KERN_INFO "%s v%u.%u %s\n",
               wanrouter_fullname, ROUTER_VERSION, ROUTER_RELEASE,
@@ -181,15 +178,6 @@ int wanrouter_init(void)
                printk(KERN_INFO "%s: can't create entry in proc filesystem!\n",
                       wanrouter_modname);
 
-        /*
-         *      Initialise compiled in boards
-         */
-
-#ifdef CONFIG_VENDOR_SANGOMA
-       sdladrv_init();
-       wanpipe_init();
-#endif
-
        return err;
 }
 
@@ -198,50 +186,13 @@ static void __exit wanrouter_cleanup (void)
        wanrouter_proc_cleanup();
 }
 
-#else
-
-/*
- *     Kernel Loadable Module Entry Points
- */
-
 /*
- *     Module 'insert' entry point.
- *     o print announcement
- *     o initialize static data
- *     o create /proc/net/router directory and static entries
- *
- *     Return: 0       Ok
- *             < 0     error.
- *     Context:        process
+ * This is just plain dumb.  We should move the bugger to drivers/net/wan,
+ * slap it first in directory and make it module_init().  The only reason
+ * for subsys_initcall() here is that net goes after drivers (why, BTW?)
  */
-
-int init_module        (void)
-{
-       int err;
-
-       printk(KERN_INFO "%s v%u.%u %s\n",
-              wanrouter_fullname, ROUTER_VERSION, ROUTER_RELEASE,
-              wanrouter_copyright);
-
-       err = wanrouter_proc_init();
-
-       if (err)
-               printk(KERN_INFO "%s: can't create entry in proc filesystem!\n",
-                      wanrouter_modname);
-       return err;
-}
-
-/*
- *     Module 'remove' entry point.
- *     o delete /proc/net/router directory and static entries.
- */
-
-void cleanup_module (void)
-{
-       wanrouter_proc_cleanup();
-}
-
-#endif
+subsys_initcall(wanrouter_init)
+module_exit(wanrouter_cleanup)
 
 /*
  *     Kernel APIs