aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/leds/led-core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/leds/led-core.c')
-rw-r--r--drivers/leds/led-core.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/leds/led-core.c b/drivers/leds/led-core.c
index 4bb116867b88..71b40d3bf776 100644
--- a/drivers/leds/led-core.c
+++ b/drivers/leds/led-core.c
@@ -16,7 +16,6 @@
16#include <linux/module.h> 16#include <linux/module.h>
17#include <linux/rwsem.h> 17#include <linux/rwsem.h>
18#include <linux/leds.h> 18#include <linux/leds.h>
19#include <linux/workqueue.h>
20#include "leds.h" 19#include "leds.h"
21 20
22DECLARE_RWSEM(leds_list_lock); 21DECLARE_RWSEM(leds_list_lock);
@@ -52,7 +51,7 @@ static void led_set_software_blink(struct led_classdev *led_cdev,
52 return; 51 return;
53 } 52 }
54 53
55 queue_delayed_work(system_wq, &led_cdev->blink_work, 1); 54 mod_timer(&led_cdev->blink_timer, jiffies + 1);
56} 55}
57 56
58 57
@@ -76,7 +75,7 @@ void led_blink_set(struct led_classdev *led_cdev,
76 unsigned long *delay_on, 75 unsigned long *delay_on,
77 unsigned long *delay_off) 76 unsigned long *delay_off)
78{ 77{
79 cancel_delayed_work_sync(&led_cdev->blink_work); 78 del_timer_sync(&led_cdev->blink_timer);
80 79
81 led_cdev->flags &= ~LED_BLINK_ONESHOT; 80 led_cdev->flags &= ~LED_BLINK_ONESHOT;
82 led_cdev->flags &= ~LED_BLINK_ONESHOT_STOP; 81 led_cdev->flags &= ~LED_BLINK_ONESHOT_STOP;
@@ -91,7 +90,7 @@ void led_blink_set_oneshot(struct led_classdev *led_cdev,
91 int invert) 90 int invert)
92{ 91{
93 if ((led_cdev->flags & LED_BLINK_ONESHOT) && 92 if ((led_cdev->flags & LED_BLINK_ONESHOT) &&
94 delayed_work_pending(&led_cdev->blink_work)) 93 timer_pending(&led_cdev->blink_timer))
95 return; 94 return;
96 95
97 led_cdev->flags |= LED_BLINK_ONESHOT; 96 led_cdev->flags |= LED_BLINK_ONESHOT;
@@ -108,7 +107,7 @@ EXPORT_SYMBOL(led_blink_set_oneshot);
108 107
109void led_stop_software_blink(struct led_classdev *led_cdev) 108void led_stop_software_blink(struct led_classdev *led_cdev)
110{ 109{
111 cancel_delayed_work_sync(&led_cdev->blink_work); 110 del_timer_sync(&led_cdev->blink_timer);
112 led_cdev->blink_delay_on = 0; 111 led_cdev->blink_delay_on = 0;
113 led_cdev->blink_delay_off = 0; 112 led_cdev->blink_delay_off = 0;
114} 113}
@@ -117,7 +116,7 @@ EXPORT_SYMBOL_GPL(led_stop_software_blink);
117void led_set_brightness(struct led_classdev *led_cdev, 116void led_set_brightness(struct led_classdev *led_cdev,
118 enum led_brightness brightness) 117 enum led_brightness brightness)
119{ 118{
120 /* delay brightness setting if need to stop soft-blink work */ 119 /* delay brightness setting if need to stop soft-blink timer */
121 if (led_cdev->blink_delay_on || led_cdev->blink_delay_off) { 120 if (led_cdev->blink_delay_on || led_cdev->blink_delay_off) {
122 led_cdev->delayed_set_value = brightness; 121 led_cdev->delayed_set_value = brightness;
123 schedule_work(&led_cdev->set_brightness_work); 122 schedule_work(&led_cdev->set_brightness_work);