linux-leds.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Amitesh Singh <singh.amitesh@gmail.com>
To: Richard Purdie <rpurdie@rpsys.net>,
	acek Anaszewski <j.anaszewski@samsung.com>,
	linux-leds@vger.kernel.org
Subject: [PATCH] leds: oneshot - Allow default delay to be passed as an argument
Date: Sat, 3 Sep 2016 14:09:25 +0530	[thread overview]
Message-ID: <20160903083921.GA15049@ami-desktop> (raw)

This patch facilates the blink delay to be passed as
an argument at the time of module loading.
e.g.
insmod ledtrigg-oneshot.ko default_delay=100
---
 drivers/leds/trigger/ledtrig-oneshot.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/leds/trigger/ledtrig-oneshot.c b/drivers/leds/trigger/ledtrig-oneshot.c
index b8ea9f0..accb241 100644
--- a/drivers/leds/trigger/ledtrig-oneshot.c
+++ b/drivers/leds/trigger/ledtrig-oneshot.c
@@ -22,6 +22,9 @@
 
 #define DEFAULT_DELAY 100
 
+static unsigned long default_delay = DEFAULT_DELAY;
+module_param(default_delay, ulong, S_IRUGO|S_IWUSR);
+
 struct oneshot_trig_data {
 	unsigned int invert;
 };
-- 
2.7.4

This patch facilates the blink delay to be passed as
    an argument at the time of module loading.
    e.g.
    insmod ledtrigg-oneshot.ko default_delay=100

             reply	other threads:[~2016-09-03  8:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-03  8:39 Amitesh Singh [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-09-03  9:03 [PATCH] leds: oneshot - Allow default delay to be passed as an argument Amitesh Singh
2016-09-03 13:44 ` Jacek Anaszewski
2016-09-03 15:39   ` Amitesh Singh
     [not found]   ` <CABKcAmXSwgMbopurjrNU7fgPu58W-ZDbDi6VuUn2P2zOGATYLQ@mail.gmail.com>
2016-09-03 18:12     ` Jacek Anaszewski
2016-09-06 15:05       ` Amitesh Singh
2016-09-06 18:52         ` Jacek Anaszewski

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=20160903083921.GA15049@ami-desktop \
    --to=singh.amitesh@gmail.com \
    --cc=j.anaszewski@samsung.com \
    --cc=linux-leds@vger.kernel.org \
    --cc=rpurdie@rpsys.net \
    /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;
as well as URLs for NNTP newsgroup(s).