aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/leds
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2008-03-23 15:28:24 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2008-04-19 22:10:28 -0400
commitb844eba292b477cda14582bfc6f535deed57a82d (patch)
treeb2418a9a4fc672654f4592ae0a3e2853d82271c3 /drivers/leds
parent138fe4e069798d9aa948a5402ff15e58f483ee4e (diff)
PM: Remove destroy_suspended_device()
After 2.6.24 there was a plan to make the PM core acquire all device semaphores during a suspend/hibernation to protect itself from concurrent operations involving device objects. That proved to be too heavy-handed and we found a better way to achieve the goal, but before it happened, we had introduced the functions device_pm_schedule_removal() and destroy_suspended_device() to allow drivers to "safely" destroy a suspended device and we had adapted some drivers to use them. Now that these functions are no longer necessary, it seems reasonable to remove them and modify their users to use the normal device unregistration instead. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/leds')
-rw-r--r--drivers/leds/led-class.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c
index 4a938780dfc3..63aad90247c4 100644
--- a/drivers/leds/led-class.c
+++ b/drivers/leds/led-class.c
@@ -139,12 +139,10 @@ EXPORT_SYMBOL_GPL(led_classdev_register);
139/** 139/**
140 * __led_classdev_unregister - unregisters a object of led_properties class. 140 * __led_classdev_unregister - unregisters a object of led_properties class.
141 * @led_cdev: the led device to unregister 141 * @led_cdev: the led device to unregister
142 * @suspended: indicates whether system-wide suspend or resume is in progress
143 * 142 *
144 * Unregisters a previously registered via led_classdev_register object. 143 * Unregisters a previously registered via led_classdev_register object.
145 */ 144 */
146void __led_classdev_unregister(struct led_classdev *led_cdev, 145void led_classdev_unregister(struct led_classdev *led_cdev)
147 bool suspended)
148{ 146{
149 device_remove_file(led_cdev->dev, &dev_attr_brightness); 147 device_remove_file(led_cdev->dev, &dev_attr_brightness);
150#ifdef CONFIG_LEDS_TRIGGERS 148#ifdef CONFIG_LEDS_TRIGGERS
@@ -155,16 +153,13 @@ void __led_classdev_unregister(struct led_classdev *led_cdev,
155 up_write(&led_cdev->trigger_lock); 153 up_write(&led_cdev->trigger_lock);
156#endif 154#endif
157 155
158 if (suspended) 156 device_unregister(led_cdev->dev);
159 device_pm_schedule_removal(led_cdev->dev);
160 else
161 device_unregister(led_cdev->dev);
162 157
163 down_write(&leds_list_lock); 158 down_write(&leds_list_lock);
164 list_del(&led_cdev->node); 159 list_del(&led_cdev->node);
165 up_write(&leds_list_lock); 160 up_write(&leds_list_lock);
166} 161}
167EXPORT_SYMBOL_GPL(__led_classdev_unregister); 162EXPORT_SYMBOL_GPL(led_classdev_unregister);
168 163
169static int __init leds_init(void) 164static int __init leds_init(void)
170{ 165{