lkml.org 
[lkml]   [2004]   [Jan]   [3]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
FromDmitry Torokhov <>
SubjectRe: [PATCH 4/7] atkbd option parsing
DateSat, 3 Jan 2004 04:01:34 -0500
===================================================================

ChangeSet@1.1574, 2004-01-03 02:45:27-05:00, dtor_core@ameritech.net
  Input: converted atkbd to the new style of option parsing.
         If compiled as a module new option names are:
         set, softrepeat, reset.
         If built into the kernel options must be prepended
         with "atkbd." prefix, like "atkbd.softrepeat"


 Documentation/kernel-parameters.txt |    7 +++---
 drivers/input/keyboard/atkbd.c      |   40 ++++++++----------------------------
 2 files changed, 13 insertions(+), 34 deletions(-)

===================================================================


diff -Nru a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
--- a/Documentation/kernel-parameters.txt	Sat Jan  3 03:09:00 2004
+++ b/Documentation/kernel-parameters.txt	Sat Jan  3 03:09:00 2004
@@ -153,10 +153,11 @@
 
 	atascsi=	[HW,SCSI] Atari SCSI
 
-	atkbd_set=	[HW] Select keyboard code set
+	atkbd.set=	[HW] Select keyboard code set
 			Format: <int>
-
-	atkbd_reset	[HW] Reset keyboard during initialization
+	atkbd.softrepeat=
+			[HW] Use software keyboard repeat
+	atkbd.reset=	[HW] Reset keyboard during initialization
 
 	autotest	[IA64]
 
diff -Nru a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
--- a/drivers/input/keyboard/atkbd.c	Sat Jan  3 03:09:00 2004
+++ b/drivers/input/keyboard/atkbd.c	Sat Jan  3 03:09:00 2004
@@ -19,6 +19,7 @@
 
 #include <linux/delay.h>
 #include <linux/module.h>
+#include <linux/moduleparam.h>
 #include <linux/slab.h>
 #include <linux/interrupt.h>
 #include <linux/init.h>
@@ -29,18 +30,23 @@
 
 MODULE_AUTHOR("Vojtech Pavlik <vojtech@suse.cz>");
 MODULE_DESCRIPTION("AT and PS/2 keyboard driver");
-MODULE_PARM(atkbd_set, "1i");
-MODULE_PARM(atkbd_reset, "1i");
-MODULE_PARM(atkbd_softrepeat, "1i");
 MODULE_LICENSE("GPL");
 
 static int atkbd_set = 2;
+module_param_named(set, atkbd_set, int, 0);
+MODULE_PARM_DESC(set, "Select keyboard code set (2 = default, 3, 4)");
+
 #if defined(__i386__) || defined (__x86_64__)
 static int atkbd_reset;
 #else
 static int atkbd_reset = 1;
 #endif
+module_param_named(reset, atkbd_reset, bool, 0);
+MODULE_PARM_DESC(reset, "Reset keyboard during initialization");
+
 static int atkbd_softrepeat;
+module_param_named(softrepeat, atkbd_softrepeat, bool, 0);
+MODULE_PARM_DESC(softrepeat, "Use software keyboard repeat");
 
 /*
  * Scancode to keycode tables. These are just the default setting, and
@@ -759,34 +765,6 @@
 	.disconnect =	atkbd_disconnect,
 	.cleanup =	atkbd_cleanup,
 };
-
-#ifndef MODULE
-static int __init atkbd_setup_set(char *str)
-{
-        int ints[4];
-        str = get_options(str, ARRAY_SIZE(ints), ints);
-        if (ints[0] > 0) atkbd_set = ints[1];
-        return 1;
-}
-static int __init atkbd_setup_reset(char *str)
-{
-        int ints[4];
-        str = get_options(str, ARRAY_SIZE(ints), ints);
-        if (ints[0] > 0) atkbd_reset = ints[1];
-        return 1;
-}
-static int __init atkbd_setup_softrepeat(char *str)
-{
-        int ints[4];
-        str = get_options(str, ARRAY_SIZE(ints), ints);
-        if (ints[0] > 0) atkbd_softrepeat = ints[1];
-        return 1;
-}
-
-__setup("atkbd_set=", atkbd_setup_set);
-__setup("atkbd_reset", atkbd_setup_reset);
-__setup("atkbd_softrepeat=", atkbd_setup_softrepeat);
-#endif
 
 int __init atkbd_init(void)
 {
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 12:59    [from the cache]
©2003-2008