aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/core.c
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/core.c
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/core.c')
-rw-r--r--drivers/base/core.c29
1 files changed, 0 insertions, 29 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c
index adbc01788447..0262fc7c45fc 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -1163,35 +1163,6 @@ void device_destroy(struct class *class, dev_t devt)
1163} 1163}
1164EXPORT_SYMBOL_GPL(device_destroy); 1164EXPORT_SYMBOL_GPL(device_destroy);
1165 1165
1166#ifdef CONFIG_PM_SLEEP
1167/**
1168 * destroy_suspended_device - asks the PM core to remove a suspended device
1169 * @class: pointer to the struct class that this device was registered with
1170 * @devt: the dev_t of the device that was previously registered
1171 *
1172 * This call notifies the PM core of the necessity to unregister a suspended
1173 * device created with a call to device_create() (devices cannot be
1174 * unregistered directly while suspended, since the PM core holds their
1175 * semaphores at that time).
1176 *
1177 * It can only be called within the scope of a system sleep transition. In
1178 * practice this means it has to be directly or indirectly invoked either by
1179 * a suspend or resume method, or by the PM core (e.g. via
1180 * disable_nonboot_cpus() or enable_nonboot_cpus()).
1181 */
1182void destroy_suspended_device(struct class *class, dev_t devt)
1183{
1184 struct device *dev;
1185
1186 dev = class_find_device(class, &devt, __match_devt);
1187 if (dev) {
1188 device_pm_schedule_removal(dev);
1189 put_device(dev);
1190 }
1191}
1192EXPORT_SYMBOL_GPL(destroy_suspended_device);
1193#endif /* CONFIG_PM_SLEEP */
1194
1195/** 1166/**
1196 * device_rename - renames a device 1167 * device_rename - renames a device
1197 * @dev: the pointer to the struct device to be renamed 1168 * @dev: the pointer to the struct device to be renamed