summaryrefslogtreecommitdiffstats
path: root/drivers/leds/led-class.c
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@rpsys.net>2008-01-01 00:09:44 +0100
committerRichard Purdie <rpurdie@rpsys.net>2008-01-01 00:09:44 +0100
commit72f8da329e07ad8a72c1f0e96b8955cfeb7c7329 (patch)
tree7440f70caf2fb70e987f814cebcdf233a17b425c /drivers/leds/led-class.c
parentMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6 (diff)
downloadlinux-72f8da329e07ad8a72c1f0e96b8955cfeb7c7329.tar.xz
linux-72f8da329e07ad8a72c1f0e96b8955cfeb7c7329.zip
leds: Fix leds_list_lock locking issues
Covert leds_list_lock to a rw_sempahore to match previous LED trigger locking fixes, fixing lock ordering. Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Diffstat (limited to 'drivers/leds/led-class.c')
-rw-r--r--drivers/leds/led-class.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c
index ba8b04b03b9f..64c66b3769c9 100644
--- a/drivers/leds/led-class.c
+++ b/drivers/leds/led-class.c
@@ -106,9 +106,9 @@ int led_classdev_register(struct device *parent, struct led_classdev *led_cdev)
goto err_out;
/* add to the list of leds */
- write_lock(&leds_list_lock);
+ down_write(&leds_list_lock);
list_add_tail(&led_cdev->node, &leds_list);
- write_unlock(&leds_list_lock);
+ up_write(&leds_list_lock);
#ifdef CONFIG_LEDS_TRIGGERS
init_rwsem(&led_cdev->trigger_lock);
@@ -155,9 +155,9 @@ void led_classdev_unregister(struct led_classdev *led_cdev)
device_unregister(led_cdev->dev);
- write_lock(&leds_list_lock);
+ down_write(&leds_list_lock);
list_del(&led_cdev->node);
- write_unlock(&leds_list_lock);
+ up_write(&leds_list_lock);
}
EXPORT_SYMBOL_GPL(led_classdev_unregister);