diff options
Diffstat (limited to 'drivers/leds')
-rw-r--r-- | drivers/leds/led-triggers.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/leds/led-triggers.c b/drivers/leds/led-triggers.c index 0f242b3f09b6..f910eaffe3a6 100644 --- a/drivers/leds/led-triggers.c +++ b/drivers/leds/led-triggers.c | |||
@@ -111,16 +111,17 @@ void led_trigger_set(struct led_classdev *led_cdev, struct led_trigger *trigger) | |||
111 | flags); | 111 | flags); |
112 | if (led_cdev->trigger->deactivate) | 112 | if (led_cdev->trigger->deactivate) |
113 | led_cdev->trigger->deactivate(led_cdev); | 113 | led_cdev->trigger->deactivate(led_cdev); |
114 | led_cdev->trigger = NULL; | ||
114 | led_set_brightness(led_cdev, LED_OFF); | 115 | led_set_brightness(led_cdev, LED_OFF); |
115 | } | 116 | } |
116 | if (trigger) { | 117 | if (trigger) { |
117 | write_lock_irqsave(&trigger->leddev_list_lock, flags); | 118 | write_lock_irqsave(&trigger->leddev_list_lock, flags); |
118 | list_add_tail(&led_cdev->trig_list, &trigger->led_cdevs); | 119 | list_add_tail(&led_cdev->trig_list, &trigger->led_cdevs); |
119 | write_unlock_irqrestore(&trigger->leddev_list_lock, flags); | 120 | write_unlock_irqrestore(&trigger->leddev_list_lock, flags); |
121 | led_cdev->trigger = trigger; | ||
120 | if (trigger->activate) | 122 | if (trigger->activate) |
121 | trigger->activate(led_cdev); | 123 | trigger->activate(led_cdev); |
122 | } | 124 | } |
123 | led_cdev->trigger = trigger; | ||
124 | } | 125 | } |
125 | EXPORT_SYMBOL_GPL(led_trigger_set); | 126 | EXPORT_SYMBOL_GPL(led_trigger_set); |
126 | 127 | ||