public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] blink: Only blink when parameter is set
@ 2007-06-17  8:39 Bernhard Walle
  2007-06-17 16:11 ` Arjan van de Ven
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Bernhard Walle @ 2007-06-17  8:39 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, Andi Kleen

This patch in the blink driver changes the module to only blink when
the parameter 'blink' is set to true. This is to allow the module to
be compiled in the kernel and not as module.

As the blink module was initially written for kdump, and as the kernel
is relocatable on lots of architectures, there's no need to compile a
separate kdump kernel. The blinking can now enabled via the boot
command line for the kdump kernel when necessary.

The patch also adds some author/license information and marks the init
function as '__init'.

Signed-off-by: Bernhard Walle <bwalle@suse.de>

---
 drivers/misc/blink.c |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

--- a/drivers/misc/blink.c
+++ b/drivers/misc/blink.c
@@ -3,6 +3,10 @@
 #include <linux/timer.h>
 #include <linux/jiffies.h>
 
+static int blink = 0;
+module_param(blink, bool, S_IRUGO);
+MODULE_PARM_DESC(blink, "Enable blinking (without that, the module does nothing)\n");
+
 static void do_blink(unsigned long data);
 
 static DEFINE_TIMER(blink_timer, do_blink, 0 ,0);
@@ -19,9 +23,16 @@ static void do_blink(unsigned long data)
 static int blink_init(void)
 {
 	printk(KERN_INFO "Enabling keyboard blinking\n");
-	do_blink(0);
+
+	if (blink)
+		do_blink(0);
+
 	return 0;
 }
 
 module_init(blink_init);
 
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Andi Kleen <ak@suse.de>");
+MODULE_DESCRIPTION("Blinks the keyboard LEDs");
+

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2007-06-22 20:45 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-17  8:39 [PATCH] blink: Only blink when parameter is set Bernhard Walle
2007-06-17 16:11 ` Arjan van de Ven
2007-06-18  4:26 ` Randy Dunlap
2007-06-18  7:18   ` Bernhard Walle
2007-06-18 14:43     ` Randy Dunlap
2007-06-20 20:16 ` Pavel Machek
2007-06-20 23:51   ` Jiri Kosina
2007-06-21  0:20     ` Pavel Machek
2007-06-21  0:24       ` Jiri Kosina
2007-06-21  2:56         ` Dmitry Torokhov
2007-06-22  8:58           ` Pavel Machek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox