All of lore.kernel.org
 help / color / mirror / Atom feed
* [2.6 patch] drivers/char/applicom.c: proper module_{init,exit}
@ 2006-05-16 17:44 Adrian Bunk
  0 siblings, 0 replies; only message in thread
From: Adrian Bunk @ 2006-05-16 17:44 UTC (permalink / raw)
  To: Andrew Morton; +Cc: David Woodhouse, linux-kernel

This patch converts the driver to use module_{init,exit}.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Acked-by: David Woodhouse <dwmw2@infradead.org>

---

 drivers/char/applicom.c |   40 ++++------------------------------------
 1 file changed, 4 insertions(+), 36 deletions(-)

--- linux-2.6.17-rc4-mm1-full/drivers/char/applicom.c.old	2006-05-16 13:58:41.000000000 +0200
+++ linux-2.6.17-rc4-mm1-full/drivers/char/applicom.c	2006-05-16 13:59:15.000000000 +0200
@@ -166,11 +166,7 @@
 	return boardno + 1;
 }
 
-#ifdef MODULE
-
-#define applicom_init init_module
-
-void cleanup_module(void)
+static void __exit applicom_exit(void)
 {
 	unsigned int i;
 
@@ -188,9 +184,7 @@
 	}
 }
 
-#endif				/* MODULE */
-
-int __init applicom_init(void)
+static int __init applicom_init(void)
 {
 	int i, numisa = 0;
 	struct pci_dev *dev = NULL;
@@ -358,10 +352,9 @@
 	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)
 {
@@ -854,28 +847,3 @@
 	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 */
-









































^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-05-16 17:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-16 17:44 [2.6 patch] drivers/char/applicom.c: proper module_{init,exit} Adrian Bunk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.