Commit 38fe9ed4 authored by Rusty Russell's avatar Rusty Russell Committed by Linus Torvalds

[PATCH] Delete init/cleanup_module prototypes in obscure places.

A few places pre-declare "int module_init(void);" and "void
module_cleanup(void);".  Other than being obsolete, this is
unneccessary (it's in init.h anyway).

There are still about 100 places which still use the
obsolete-since-2.2 "a function named module_init() magically gets
called": this change frees us up implement that via a macro.
parent f965803d
......@@ -222,9 +222,6 @@ MODULE_PARM(drive3, "1-7i");
#define ATAPI_READ_10 0x28
#define ATAPI_WRITE_10 0x2a
#ifdef MODULE
void cleanup_module(void);
#endif
static int pf_open(struct inode *inode, struct file *file);
static void do_pf_request(request_queue_t * q);
static int pf_ioctl(struct inode *inode, struct file *file,
......
......@@ -650,8 +650,6 @@ static unsigned int stli_baudrates[] = {
*/
#ifdef MODULE
int init_module(void);
void cleanup_module(void);
static void stli_argbrds(void);
static int stli_parsebrd(stlconf_t *confp, char **argp);
......
......@@ -216,10 +216,7 @@ static struct timer_list moxaEmptyTimer[MAX_PORTS];
static struct semaphore moxaBuffSem;
int moxa_init(void);
#ifdef MODULE
int init_module(void);
void cleanup_module(void);
#endif
/*
* static functions:
*/
......
......@@ -32,10 +32,6 @@ int button_init (void);
int button_add_callback (void (*callback) (void), int count);
int button_del_callback (void (*callback) (void));
static void button_consume_callbacks (int bpcount);
#ifdef MODULE
int init_module (void);
void cleanup_module (void);
#endif /* MODULE */
#else /* Not compiling the driver itself */
......
......@@ -209,17 +209,9 @@ static void cleanup_board_resources(void)
#ifdef MODULE
/*
* pcxe_init() is our init_module():
*/
#define pcxe_init init_module
void cleanup_module(void);
/*****************************************************************************/
void cleanup_module()
static void pcxe_cleanup()
{
unsigned long flags;
......@@ -240,6 +232,12 @@ void cleanup_module()
kfree(digi_channels);
restore_flags(flags);
}
/*
* pcxe_init() is our init_module():
*/
module_init(pcxe_init);
module_cleanup(pcxe_cleanup);
#endif
static inline struct channel *chan(register struct tty_struct *tty)
......
......@@ -472,8 +472,6 @@ static unsigned int stl_baudrates[] = {
*/
#ifdef MODULE
int init_module(void);
void cleanup_module(void);
static void stl_argbrds(void);
static int stl_parsebrd(stlconf_t *confp, char **argp);
......
......@@ -160,10 +160,6 @@
/****** Function Prototypes *************************************************/
/* Module entry points. These are called by the OS and must be public. */
int init_module (void);
void cleanup_module (void);
/* Hardware-specific functions */
static int sdla_detect (sdlahw_t* hw);
static int sdla_autodpm (sdlahw_t* hw);
......@@ -325,11 +321,7 @@ static int pci_slot_ar[MAX_S514_CARDS];
* Context: process
*/
#ifdef MODULE
int init_module (void)
#else
int sdladrv_init(void)
#endif
{
int i=0;
......@@ -354,9 +346,12 @@ int sdladrv_init(void)
* Module 'remove' entry point.
* o release all remaining system resources
*/
void cleanup_module (void)
static void sdladrv_cleanup(void)
{
}
module_init(sdladrv_init);
module_cleanup(sdladrv_cleanup);
#endif
/******* Kernel APIs ********************************************************/
......
......@@ -177,10 +177,6 @@ static void dbg_kfree(void * v, int line) {
extern void disable_irq(unsigned int);
extern void enable_irq(unsigned int);
/* Module entry points */
int init_module (void);
void cleanup_module (void);
/* WAN link driver entry points */
static int setup(struct wan_device* wandev, wandev_conf_t* conf);
static int shutdown(struct wan_device* wandev);
......@@ -246,11 +242,7 @@ static int wanpipe_bh_critical=0;
* Context: process
*/
#ifdef MODULE
int init_module (void)
#else
int wanpipe_init(void)
#endif
{
int cnt, err = 0;
......@@ -313,7 +305,7 @@ int wanpipe_init(void)
* o unregister all adapters from the WAN router
* o release all remaining system resources
*/
void cleanup_module (void)
static void wanpipe_cleanup(void)
{
int i;
......@@ -329,6 +321,8 @@ void cleanup_module (void)
printk(KERN_INFO "\nwanpipe: WANPIPE Modules Unloaded.\n");
}
module_init(wanpipe_init);
module_exit(wanpipe_cleanup);
#endif
/******* WAN Device Driver Entry Points *************************************/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment