* Context: process
*/
-int sdladrv_init(void)
+static int __init sdladrv_init(void)
{
int i=0;
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 ********************************************************/
#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 */
* Context: process
*/
-int wanpipe_init(void)
+static int __init wanpipe_init(void)
{
int cnt, err = 0;
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;
module_init(wanpipe_init);
module_exit(wanpipe_cleanup);
-#endif
/******* WAN Device Driver Entry Points *************************************/
#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. */
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,
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;
}
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