aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/leds/led-class.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/leds/led-class.c')
-rw-r--r--drivers/leds/led-class.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c
index 4211293ce862..ba8b04b03b9f 100644
--- a/drivers/leds/led-class.c
+++ b/drivers/leds/led-class.c
@@ -111,7 +111,7 @@ int led_classdev_register(struct device *parent, struct led_classdev *led_cdev)
111 write_unlock(&leds_list_lock); 111 write_unlock(&leds_list_lock);
112 112
113#ifdef CONFIG_LEDS_TRIGGERS 113#ifdef CONFIG_LEDS_TRIGGERS
114 rwlock_init(&led_cdev->trigger_lock); 114 init_rwsem(&led_cdev->trigger_lock);
115 115
116 rc = device_create_file(led_cdev->dev, &dev_attr_trigger); 116 rc = device_create_file(led_cdev->dev, &dev_attr_trigger);
117 if (rc) 117 if (rc)
@@ -147,10 +147,10 @@ void led_classdev_unregister(struct led_classdev *led_cdev)
147 device_remove_file(led_cdev->dev, &dev_attr_brightness); 147 device_remove_file(led_cdev->dev, &dev_attr_brightness);
148#ifdef CONFIG_LEDS_TRIGGERS 148#ifdef CONFIG_LEDS_TRIGGERS
149 device_remove_file(led_cdev->dev, &dev_attr_trigger); 149 device_remove_file(led_cdev->dev, &dev_attr_trigger);
150 write_lock(&led_cdev->trigger_lock); 150 down_write(&led_cdev->trigger_lock);
151 if (led_cdev->trigger) 151 if (led_cdev->trigger)
152 led_trigger_set(led_cdev, NULL); 152 led_trigger_set(led_cdev, NULL);
153 write_unlock(&led_cdev->trigger_lock); 153 up_write(&led_cdev->trigger_lock);
154#endif 154#endif
155 155
156 device_unregister(led_cdev->dev); 156 device_unregister(led_cdev->dev);