aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShuah Khan <shuahkhan@gmail.com>2012-05-29 18:07:28 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-05-29 19:22:31 -0400
commit1381187991a196a8a7d046e97bd50eec6c37e8df (patch)
treef84e83866b4d15cad012cb40c5b653ce4c49a7d9
parent03c091e5b726ada6aaf9af1d0e973679099101e4 (diff)
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 <shuahkhan@gmail.com> Cc: Richard Purdie <rpurdie@rpsys.net> Cc: Bryan Wu <bryan.wu@canonical.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/leds/ledtrig-timer.c6
1 files 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)
87 87
88 led_blink_set(led_cdev, &led_cdev->blink_delay_on, 88 led_blink_set(led_cdev, &led_cdev->blink_delay_on,
89 &led_cdev->blink_delay_off); 89 &led_cdev->blink_delay_off);
90 90 led_cdev->activated = true;
91 led_cdev->trigger_data = (void *)1;
92 91
93 return; 92 return;
94 93
@@ -98,9 +97,10 @@ err_out_delayon:
98 97
99static void timer_trig_deactivate(struct led_classdev *led_cdev) 98static void timer_trig_deactivate(struct led_classdev *led_cdev)
100{ 99{
101 if (led_cdev->trigger_data) { 100 if (led_cdev->activated) {
102 device_remove_file(led_cdev->dev, &dev_attr_delay_on); 101 device_remove_file(led_cdev->dev, &dev_attr_delay_on);
103 device_remove_file(led_cdev->dev, &dev_attr_delay_off); 102 device_remove_file(led_cdev->dev, &dev_attr_delay_off);
103 led_cdev->activated = false;
104 } 104 }
105 105
106 /* Stop blinking */ 106 /* Stop blinking */