提交 22f933ad 编写于 作者: R Rob Herring 提交者: Jacek Anaszewski

leds: ledtrig-transient: fix duration to be msec instead of jiffies

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: NRob Herring <robh@kernel.org>
Cc: Shuah Khan <shuahkhan@gmail.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: linux-leds@vger.kernel.org
Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
上级 df8ff5d2
...@@ -85,7 +85,7 @@ static ssize_t transient_activate_store(struct device *dev, ...@@ -85,7 +85,7 @@ static ssize_t transient_activate_store(struct device *dev,
transient_data->restore_state = transient_data->restore_state =
(transient_data->state == LED_FULL) ? LED_OFF : LED_FULL; (transient_data->state == LED_FULL) ? LED_OFF : LED_FULL;
mod_timer(&transient_data->timer, mod_timer(&transient_data->timer,
jiffies + transient_data->duration); jiffies + msecs_to_jiffies(transient_data->duration));
} }
/* state == 0 && transient_data->activate == 0 /* state == 0 && transient_data->activate == 0
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册