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"); ...@@ -222,9 +222,6 @@ MODULE_PARM(drive3, "1-7i");
#define ATAPI_READ_10 0x28 #define ATAPI_READ_10 0x28
#define ATAPI_WRITE_10 0x2a #define ATAPI_WRITE_10 0x2a
#ifdef MODULE
void cleanup_module(void);
#endif
static int pf_open(struct inode *inode, struct file *file); static int pf_open(struct inode *inode, struct file *file);
static void do_pf_request(request_queue_t * q); static void do_pf_request(request_queue_t * q);
static int pf_ioctl(struct inode *inode, struct file *file, static int pf_ioctl(struct inode *inode, struct file *file,
......
...@@ -650,8 +650,6 @@ static unsigned int stli_baudrates[] = { ...@@ -650,8 +650,6 @@ static unsigned int stli_baudrates[] = {
*/ */
#ifdef MODULE #ifdef MODULE
int init_module(void);
void cleanup_module(void);
static void stli_argbrds(void); static void stli_argbrds(void);
static int stli_parsebrd(stlconf_t *confp, char **argp); static int stli_parsebrd(stlconf_t *confp, char **argp);
......
...@@ -216,10 +216,7 @@ static struct timer_list moxaEmptyTimer[MAX_PORTS]; ...@@ -216,10 +216,7 @@ static struct timer_list moxaEmptyTimer[MAX_PORTS];
static struct semaphore moxaBuffSem; static struct semaphore moxaBuffSem;
int moxa_init(void); int moxa_init(void);
#ifdef MODULE
int init_module(void);
void cleanup_module(void);
#endif
/* /*
* static functions: * static functions:
*/ */
......
...@@ -32,10 +32,6 @@ int button_init (void); ...@@ -32,10 +32,6 @@ int button_init (void);
int button_add_callback (void (*callback) (void), int count); int button_add_callback (void (*callback) (void), int count);
int button_del_callback (void (*callback) (void)); int button_del_callback (void (*callback) (void));
static void button_consume_callbacks (int bpcount); 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 */ #else /* Not compiling the driver itself */
......
...@@ -209,17 +209,9 @@ static void cleanup_board_resources(void) ...@@ -209,17 +209,9 @@ static void cleanup_board_resources(void)
#ifdef MODULE #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; unsigned long flags;
...@@ -240,6 +232,12 @@ void cleanup_module() ...@@ -240,6 +232,12 @@ void cleanup_module()
kfree(digi_channels); kfree(digi_channels);
restore_flags(flags); restore_flags(flags);
} }
/*
* pcxe_init() is our init_module():
*/
module_init(pcxe_init);
module_cleanup(pcxe_cleanup);
#endif #endif
static inline struct channel *chan(register struct tty_struct *tty) static inline struct channel *chan(register struct tty_struct *tty)
......
...@@ -472,8 +472,6 @@ static unsigned int stl_baudrates[] = { ...@@ -472,8 +472,6 @@ static unsigned int stl_baudrates[] = {
*/ */
#ifdef MODULE #ifdef MODULE
int init_module(void);
void cleanup_module(void);
static void stl_argbrds(void); static void stl_argbrds(void);
static int stl_parsebrd(stlconf_t *confp, char **argp); static int stl_parsebrd(stlconf_t *confp, char **argp);
......
...@@ -160,10 +160,6 @@ ...@@ -160,10 +160,6 @@
/****** Function Prototypes *************************************************/ /****** 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 */ /* Hardware-specific functions */
static int sdla_detect (sdlahw_t* hw); static int sdla_detect (sdlahw_t* hw);
static int sdla_autodpm (sdlahw_t* hw); static int sdla_autodpm (sdlahw_t* hw);
...@@ -325,11 +321,7 @@ static int pci_slot_ar[MAX_S514_CARDS]; ...@@ -325,11 +321,7 @@ static int pci_slot_ar[MAX_S514_CARDS];
* Context: process * Context: process
*/ */
#ifdef MODULE
int init_module (void)
#else
int sdladrv_init(void) int sdladrv_init(void)
#endif
{ {
int i=0; int i=0;
...@@ -354,9 +346,12 @@ int sdladrv_init(void) ...@@ -354,9 +346,12 @@ int sdladrv_init(void)
* Module 'remove' entry point. * Module 'remove' entry point.
* o release all remaining system resources * o release all remaining system resources
*/ */
void cleanup_module (void) static void sdladrv_cleanup(void)
{ {
} }
module_init(sdladrv_init);
module_cleanup(sdladrv_cleanup);
#endif #endif
/******* Kernel APIs ********************************************************/ /******* Kernel APIs ********************************************************/
......
...@@ -177,10 +177,6 @@ static void dbg_kfree(void * v, int line) { ...@@ -177,10 +177,6 @@ static void dbg_kfree(void * v, int line) {
extern void disable_irq(unsigned int); extern void disable_irq(unsigned int);
extern void enable_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 */ /* WAN link driver entry points */
static int setup(struct wan_device* wandev, wandev_conf_t* conf); static int setup(struct wan_device* wandev, wandev_conf_t* conf);
static int shutdown(struct wan_device* wandev); static int shutdown(struct wan_device* wandev);
...@@ -246,11 +242,7 @@ static int wanpipe_bh_critical=0; ...@@ -246,11 +242,7 @@ static int wanpipe_bh_critical=0;
* Context: process * Context: process
*/ */
#ifdef MODULE
int init_module (void)
#else
int wanpipe_init(void) int wanpipe_init(void)
#endif
{ {
int cnt, err = 0; int cnt, err = 0;
...@@ -313,7 +305,7 @@ int wanpipe_init(void) ...@@ -313,7 +305,7 @@ int wanpipe_init(void)
* o unregister all adapters from the WAN router * o unregister all adapters from the WAN router
* o release all remaining system resources * o release all remaining system resources
*/ */
void cleanup_module (void) static void wanpipe_cleanup(void)
{ {
int i; int i;
...@@ -329,6 +321,8 @@ void cleanup_module (void) ...@@ -329,6 +321,8 @@ void cleanup_module (void)
printk(KERN_INFO "\nwanpipe: WANPIPE Modules Unloaded.\n"); printk(KERN_INFO "\nwanpipe: WANPIPE Modules Unloaded.\n");
} }
module_init(wanpipe_init);
module_exit(wanpipe_cleanup);
#endif #endif
/******* WAN Device Driver Entry Points *************************************/ /******* 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