aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/leds/led-triggers.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/leds/led-triggers.c')
-rw-r--r--drivers/leds/led-triggers.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/leds/led-triggers.c b/drivers/leds/led-triggers.c
index 0bdb786210b1..13c9026d68af 100644
--- a/drivers/leds/led-triggers.c
+++ b/drivers/leds/led-triggers.c
@@ -169,7 +169,7 @@ int led_trigger_register(struct led_trigger *trigger)
169 up_write(&triggers_list_lock); 169 up_write(&triggers_list_lock);
170 170
171 /* Register with any LEDs that have this as a default trigger */ 171 /* Register with any LEDs that have this as a default trigger */
172 read_lock(&leds_list_lock); 172 down_read(&leds_list_lock);
173 list_for_each_entry(led_cdev, &leds_list, node) { 173 list_for_each_entry(led_cdev, &leds_list, node) {
174 down_write(&led_cdev->trigger_lock); 174 down_write(&led_cdev->trigger_lock);
175 if (!led_cdev->trigger && led_cdev->default_trigger && 175 if (!led_cdev->trigger && led_cdev->default_trigger &&
@@ -177,7 +177,7 @@ int led_trigger_register(struct led_trigger *trigger)
177 led_trigger_set(led_cdev, trigger); 177 led_trigger_set(led_cdev, trigger);
178 up_write(&led_cdev->trigger_lock); 178 up_write(&led_cdev->trigger_lock);
179 } 179 }
180 read_unlock(&leds_list_lock); 180 up_read(&leds_list_lock);
181 181
182 return 0; 182 return 0;
183} 183}
@@ -212,14 +212,14 @@ void led_trigger_unregister(struct led_trigger *trigger)
212 up_write(&triggers_list_lock); 212 up_write(&triggers_list_lock);
213 213
214 /* Remove anyone actively using this trigger */ 214 /* Remove anyone actively using this trigger */
215 read_lock(&leds_list_lock); 215 down_read(&leds_list_lock);
216 list_for_each_entry(led_cdev, &leds_list, node) { 216 list_for_each_entry(led_cdev, &leds_list, node) {
217 down_write(&led_cdev->trigger_lock); 217 down_write(&led_cdev->trigger_lock);
218 if (led_cdev->trigger == trigger) 218 if (led_cdev->trigger == trigger)
219 led_trigger_set(led_cdev, NULL); 219 led_trigger_set(led_cdev, NULL);
220 up_write(&led_cdev->trigger_lock); 220 up_write(&led_cdev->trigger_lock);
221 } 221 }
222 read_unlock(&leds_list_lock); 222 up_read(&leds_list_lock);
223} 223}
224 224
225void led_trigger_unregister_simple(struct led_trigger *trigger) 225void led_trigger_unregister_simple(struct led_trigger *trigger)