public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bernhard Walle <bwalle@suse.de>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, Andi Kleen <ak@suse.de>
Subject: [PATCH] blink: Only blink when parameter is set
Date: Sun, 17 Jun 2007 10:39:04 +0200	[thread overview]
Message-ID: <20070617083904.GC4496@suse.de> (raw)

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");
+

             reply	other threads:[~2007-06-17  8:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-17  8:39 Bernhard Walle [this message]
2007-06-17 16:11 ` [PATCH] blink: Only blink when parameter is set 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070617083904.GC4496@suse.de \
    --to=bwalle@suse.de \
    --cc=ak@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox