summaryrefslogtreecommitdiff
path: root/drivers/leds/led-core.c
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2017-10-25 03:30:01 -0700
committerJacek Anaszewski <jacek.anaszewski@gmail.com>2017-10-25 21:52:22 +0200
commit49404665b935447d4f2d5509fbff569b7bf8c495 (patch)
treeffd76d54cf5547b6a29d5f401c29803dd1cf2add /drivers/leds/led-core.c
parent3f3d60d6254cfe0b1a2ab675ec1f72f232314eff (diff)
leds: Convert timers to use timer_setup()
In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly. Cc: Richard Purdie <rpurdie@rpsys.net> Cc: Pavel Machek <pavel@ucw.cz> Cc: Willy Tarreau <w@1wt.eu> Cc: linux-leds@vger.kernel.org Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
Diffstat (limited to 'drivers/leds/led-core.c')
-rw-r--r--drivers/leds/led-core.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/leds/led-core.c b/drivers/leds/led-core.c
index ef1360445413..fd83c7f77a95 100644
--- a/drivers/leds/led-core.c
+++ b/drivers/leds/led-core.c
@@ -45,9 +45,9 @@ static int __led_set_brightness_blocking(struct led_classdev *led_cdev,
return led_cdev->brightness_set_blocking(led_cdev, value);
}
-static void led_timer_function(unsigned long data)
+static void led_timer_function(struct timer_list *t)
{
- struct led_classdev *led_cdev = (void *)data;
+ struct led_classdev *led_cdev = from_timer(led_cdev, t, blink_timer);
unsigned long brightness;
unsigned long delay;
@@ -178,8 +178,7 @@ void led_init_core(struct led_classdev *led_cdev)
{
INIT_WORK(&led_cdev->set_brightness_work, set_brightness_delayed);
- setup_timer(&led_cdev->blink_timer, led_timer_function,
- (unsigned long)led_cdev);
+ timer_setup(&led_cdev->blink_timer, led_timer_function, 0);
}
EXPORT_SYMBOL_GPL(led_init_core);