aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/power
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/base/power
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/base/power')
-rw-r--r--drivers/base/power/main.c40
1 files changed, 0 insertions, 40 deletions
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index 5630af302b2f..c4568b82875b 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -50,7 +50,6 @@
50LIST_HEAD(dpm_active); 50LIST_HEAD(dpm_active);
51static LIST_HEAD(dpm_off); 51static LIST_HEAD(dpm_off);
52static LIST_HEAD(dpm_off_irq); 52static LIST_HEAD(dpm_off_irq);
53static LIST_HEAD(dpm_destroy);
54 53
55static DEFINE_MUTEX(dpm_list_mtx); 54static DEFINE_MUTEX(dpm_list_mtx);
56 55
@@ -104,24 +103,6 @@ void device_pm_remove(struct device *dev)
104 mutex_unlock(&dpm_list_mtx); 103 mutex_unlock(&dpm_list_mtx);
105} 104}
106 105
107/**
108 * device_pm_schedule_removal - schedule the removal of a suspended device
109 * @dev: Device to destroy
110 *
111 * Moves the device to the dpm_destroy list for further processing by
112 * unregister_dropped_devices().
113 */
114void device_pm_schedule_removal(struct device *dev)
115{
116 pr_debug("PM: Preparing for removal: %s:%s\n",
117 dev->bus ? dev->bus->name : "No Bus",
118 kobject_name(&dev->kobj));
119 mutex_lock(&dpm_list_mtx);
120 list_move_tail(&dev->power.entry, &dpm_destroy);
121 mutex_unlock(&dpm_list_mtx);
122}
123EXPORT_SYMBOL_GPL(device_pm_schedule_removal);
124
125/*------------------------- Resume routines -------------------------*/ 106/*------------------------- Resume routines -------------------------*/
126 107
127/** 108/**
@@ -246,26 +227,6 @@ static void dpm_resume(void)
246} 227}
247 228
248/** 229/**
249 * unregister_dropped_devices - Unregister devices scheduled for removal
250 *
251 * Unregister all devices on the dpm_destroy list.
252 */
253static void unregister_dropped_devices(void)
254{
255 mutex_lock(&dpm_list_mtx);
256 while (!list_empty(&dpm_destroy)) {
257 struct list_head *entry = dpm_destroy.next;
258 struct device *dev = to_device(entry);
259
260 mutex_unlock(&dpm_list_mtx);
261 /* This also removes the device from the list */
262 device_unregister(dev);
263 mutex_lock(&dpm_list_mtx);
264 }
265 mutex_unlock(&dpm_list_mtx);
266}
267
268/**
269 * device_resume - Restore state of each device in system. 230 * device_resume - Restore state of each device in system.
270 * 231 *
271 * Resume all the devices, unlock them all, and allow new 232 * Resume all the devices, unlock them all, and allow new
@@ -275,7 +236,6 @@ void device_resume(void)
275{ 236{
276 might_sleep(); 237 might_sleep();
277 dpm_resume(); 238 dpm_resume();
278 unregister_dropped_devices();
279} 239}
280EXPORT_SYMBOL_GPL(device_resume); 240EXPORT_SYMBOL_GPL(device_resume);
281 241