patch-2.3.26 linux/drivers/char/logibusmouse.c

Next file: linux/drivers/char/msbusmouse.c
Previous file: linux/drivers/char/joystick/joystick.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.25/linux/drivers/char/logibusmouse.c linux/drivers/char/logibusmouse.c
@@ -40,6 +40,7 @@
 
 #include <linux/kernel.h>
 #include <linux/sched.h>
+#include <linux/init.h>
 #include <linux/logibusmouse.h>
 #include <linux/signal.h>
 #include <linux/errno.h>
@@ -49,7 +50,6 @@
 #include <linux/random.h>
 #include <linux/delay.h>
 #include <linux/ioport.h>
-#include <linux/init.h>
 
 #include <asm/io.h>
 #include <asm/uaccess.h>
@@ -61,16 +61,26 @@
 static int msedev;
 static int mouse_irq = MOUSE_IRQ;
 
-#ifdef MODULE
 MODULE_PARM(mouse_irq, "i");
-#endif
 
-void __init bmouse_setup(char *str, int *ints)
+#ifndef MODULE
+
+static int __init bmouse_setup(char *str)
 {
+	int ints[4];
+
+	str = get_options(str, ARRAY_SIZE(ints), ints);
+
 	if (ints[0] > 0)
 		mouse_irq=ints[1];
+
+	return 1;
 }
 
+__setup("logi_busmouse=", bmouse_setup);
+
+#endif /* !MODULE */
+
 static void mouse_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	char dx, dy;
@@ -118,7 +128,7 @@
 	LOGITECH_BUSMOUSE, "busmouse", open_mouse, close_mouse, 7
 };
 
-int __init logi_busmouse_init(void)
+static int __init logi_busmouse_init(void)
 {
 	if (check_region(LOGIBM_BASE, LOGIBM_EXTENT))
 		return -EIO;
@@ -142,16 +152,11 @@
 	return msedev < 0 ? msedev : 0;
 }
 
-#ifdef MODULE
-
-int init_module(void)
-{
-	return logi_busmouse_init();
-}
-
-void cleanup_module(void)
+static void __exit logi_busmouse_cleanup (void)
 {
 	unregister_busmouse(msedev);
 	release_region(LOGIBM_BASE, LOGIBM_EXTENT);
 }
-#endif
+
+module_init(logi_busmouse_init);
+module_exit(logi_busmouse_cleanup);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)