Skip to content

Commit 2e61139

Browse files
AdrianBunkLinus Torvalds
authored andcommitted
[PATCH] drivers/char/applicom.c: proper module_{init,exit}
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>
1 parent 59cc185 commit 2e61139

1 file changed

Lines changed: 4 additions & 36 deletions

File tree

‎drivers/char/applicom.c‎

Lines changed: 4 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,7 @@ static int ac_register_board(unsigned long physloc, void __iomem *loc,
166166
return boardno + 1;
167167
}
168168

169-
#ifdef MODULE
170-
171-
#define applicom_init init_module
172-
173-
void cleanup_module(void)
169+
static void __exit applicom_exit(void)
174170
{
175171
unsigned int i;
176172

@@ -188,9 +184,7 @@ void cleanup_module(void)
188184
}
189185
}
190186

191-
#endif /* MODULE */
192-
193-
int __init applicom_init(void)
187+
static int __init applicom_init(void)
194188
{
195189
int i, numisa = 0;
196190
struct pci_dev *dev = NULL;
@@ -355,10 +349,9 @@ int __init applicom_init(void)
355349
return ret;
356350
}
357351

352+
module_init(applicom_init);
353+
module_exit(applicom_exit);
358354

359-
#ifndef MODULE
360-
__initcall(applicom_init);
361-
#endif
362355

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

854-
#ifndef MODULE
855-
static int __init applicom_setup(char *str)
856-
{
857-
int ints[4];
858-
859-
(void) get_options(str, 4, ints);
860-
861-
if (ints[0] > 2) {
862-
printk(KERN_WARNING "Too many arguments to 'applicom=', expected mem,irq only.\n");
863-
}
864-
865-
if (ints[0] < 2) {
866-
printk(KERN_INFO"applicom numargs: %d\n", ints[0]);
867-
return 0;
868-
}
869-
870-
mem = ints[1];
871-
irq = ints[2];
872-
return 1;
873-
}
874-
875-
__setup("applicom=", applicom_setup);
876-
877-
#endif /* MODULE */
878-

0 commit comments

Comments
 (0)