From: Jacek Anaszewski <j.anaszewski@samsung.com>
To: Rob Herring <robh@kernel.org>
Cc: Shuah Khan <shuahkhan@gmail.com>,
Richard Purdie <rpurdie@rpsys.net>,
linux-leds@vger.kernel.org
Subject: Re: [PATCH] leds: ledtrig-transient: fix duration to be msec instead of jiffies
Date: Mon, 16 Nov 2015 14:20:22 +0100 [thread overview]
Message-ID: <5649D816.9080109@samsung.com> (raw)
In-Reply-To: <1447197017-4783-1-git-send-email-robh@kernel.org>
Hi Rob,
On 11/11/2015 12:10 AM, Rob Herring wrote:
> The transient trigger duration is documented to be in msec units, but is
> actually in jiffies units. Other time based triggers are in msec units
> as well. Fix the timer setup to convert from msec.
>
> This could break an existing userspace that worked around this problem,
> but exposing jiffies to userspace is just wrong and would break anyway
> if HZ is changed.
>
> Signed-off-by: Rob Herring <robh@kernel.org>
> Cc: Shuah Khan <shuahkhan@gmail.com>
> Cc: Richard Purdie <rpurdie@rpsys.net>
> Cc: Jacek Anaszewski <j.anaszewski@samsung.com>
> Cc: linux-leds@vger.kernel.org
> ---
> drivers/leds/trigger/ledtrig-transient.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/leds/trigger/ledtrig-transient.c b/drivers/leds/trigger/ledtrig-transient.c
> index 3c34de4..60034bf 100644
> --- a/drivers/leds/trigger/ledtrig-transient.c
> +++ b/drivers/leds/trigger/ledtrig-transient.c
> @@ -85,7 +85,7 @@ static ssize_t transient_activate_store(struct device *dev,
> transient_data->restore_state =
> (transient_data->state == LED_FULL) ? LED_OFF : LED_FULL;
> mod_timer(&transient_data->timer,
> - jiffies + transient_data->duration);
> + jiffies + msecs_to_jiffies(transient_data->duration));
> }
>
> /* state == 0 && transient_data->activate == 0
>
Applied, thanks.
--
Best Regards,
Jacek Anaszewski
prev parent reply other threads:[~2015-11-16 13:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-10 23:10 [PATCH] leds: ledtrig-transient: fix duration to be msec instead of jiffies Rob Herring
2015-11-16 13:20 ` Jacek Anaszewski [this message]
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=5649D816.9080109@samsung.com \
--to=j.anaszewski@samsung.com \
--cc=linux-leds@vger.kernel.org \
--cc=robh@kernel.org \
--cc=rpurdie@rpsys.net \
--cc=shuahkhan@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.