From 8b5906fac9f7092a3d71f925060766fc5ef8e3e6 Mon Sep 17 00:00:00 2001 From: Shuah Khan Date: Wed, 25 Apr 2012 11:04:31 +1000 Subject: [PATCH] leds: change ledtrig-timer to use activated flag Change existing timer trigger to use the new ->activated flag to set activate successful status in activate routine and check it in deactivate routine to do cleanup. Signed-off-by: Shuah Khan Cc: Richard Purdie Signed-off-by: Andrew Morton --- drivers/leds/ledtrig-timer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/leds/ledtrig-timer.c b/drivers/leds/ledtrig-timer.c index b32d5eae8227..9010f7abaf2c 100644 --- a/drivers/leds/ledtrig-timer.c +++ b/drivers/leds/ledtrig-timer.c @@ -87,8 +87,7 @@ static void timer_trig_activate(struct led_classdev *led_cdev) led_blink_set(led_cdev, &led_cdev->blink_delay_on, &led_cdev->blink_delay_off); - - led_cdev->trigger_data = (void *)1; + led_cdev->activated = true; return; @@ -98,9 +97,10 @@ err_out_delayon: static void timer_trig_deactivate(struct led_classdev *led_cdev) { - if (led_cdev->trigger_data) { + if (led_cdev->activated) { device_remove_file(led_cdev->dev, &dev_attr_delay_on); device_remove_file(led_cdev->dev, &dev_attr_delay_off); + led_cdev->activated = false; } /* Stop blinking */ -- 2.39.5