Skip to content

Commit

Permalink
[PATCH] drivers/char/applicom.c: proper module_{init,exit}
Browse files Browse the repository at this point in the history
Convert the driver to use module_{init,exit}.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Acked-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
AdrianBunk authored and Linus Torvalds committed Jun 25, 2006
1 parent 59cc185 commit 2e61139
Showing 1 changed file with 4 additions and 36 deletions.
40 changes: 4 additions & 36 deletions drivers/char/applicom.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,7 @@ static int ac_register_board(unsigned long physloc, void __iomem *loc,
return boardno + 1;
}

#ifdef MODULE

#define applicom_init init_module

void cleanup_module(void)
static void __exit applicom_exit(void)
{
unsigned int i;

Expand All @@ -188,9 +184,7 @@ void cleanup_module(void)
}
}

#endif /* MODULE */

int __init applicom_init(void)
static int __init applicom_init(void)
{
int i, numisa = 0;
struct pci_dev *dev = NULL;
Expand Down Expand Up @@ -355,10 +349,9 @@ int __init applicom_init(void)
return ret;
}

module_init(applicom_init);
module_exit(applicom_exit);

#ifndef MODULE
__initcall(applicom_init);
#endif

static ssize_t ac_write(struct file *file, const char __user *buf, size_t count, loff_t * ppos)
{
Expand Down Expand Up @@ -851,28 +844,3 @@ static int ac_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
return 0;
}

#ifndef MODULE
static int __init applicom_setup(char *str)
{
int ints[4];

(void) get_options(str, 4, ints);

if (ints[0] > 2) {
printk(KERN_WARNING "Too many arguments to 'applicom=', expected mem,irq only.\n");
}

if (ints[0] < 2) {
printk(KERN_INFO"applicom numargs: %d\n", ints[0]);
return 0;
}

mem = ints[1];
irq = ints[2];
return 1;
}

__setup("applicom=", applicom_setup);

#endif /* MODULE */

0 comments on commit 2e61139

Please sign in to comment.