From: Rob Herring Date: Tue, 10 Nov 2015 23:10:17 +0000 (-0600) Subject: leds: ledtrig-transient: fix duration to be msec instead of jiffies X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=22f933add429523923360e3d0c171c7df1bd4981;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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: Rob Herring Cc: Shuah Khan Cc: Richard Purdie Cc: linux-leds@vger.kernel.org Signed-off-by: Jacek Anaszewski --- diff --git a/drivers/leds/trigger/ledtrig-transient.c b/drivers/leds/trigger/ledtrig-transient.c index 1dddd8f63e2a..7e6011bd3646 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