diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2008-03-23 15:28:24 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-04-19 22:10:28 -0400 |
commit | b844eba292b477cda14582bfc6f535deed57a82d (patch) | |
tree | b2418a9a4fc672654f4592ae0a3e2853d82271c3 /drivers/char/misc.c | |
parent | 138fe4e069798d9aa948a5402ff15e58f483ee4e (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/char/misc.c')
-rw-r--r-- | drivers/char/misc.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/char/misc.c b/drivers/char/misc.c index a39101feb2ed..4d058dadbfcc 100644 --- a/drivers/char/misc.c +++ b/drivers/char/misc.c | |||
@@ -232,9 +232,8 @@ int misc_register(struct miscdevice * misc) | |||
232 | } | 232 | } |
233 | 233 | ||
234 | /** | 234 | /** |
235 | * __misc_deregister - unregister a miscellaneous device | 235 | * misc_deregister - unregister a miscellaneous device |
236 | * @misc: device to unregister | 236 | * @misc: device to unregister |
237 | * @suspended: to be set if the function is used during suspend/resume | ||
238 | * | 237 | * |
239 | * Unregister a miscellaneous device that was previously | 238 | * Unregister a miscellaneous device that was previously |
240 | * successfully registered with misc_register(). Success | 239 | * successfully registered with misc_register(). Success |
@@ -242,7 +241,7 @@ int misc_register(struct miscdevice * misc) | |||
242 | * indicates an error. | 241 | * indicates an error. |
243 | */ | 242 | */ |
244 | 243 | ||
245 | int __misc_deregister(struct miscdevice *misc, bool suspended) | 244 | int misc_deregister(struct miscdevice *misc) |
246 | { | 245 | { |
247 | int i = misc->minor; | 246 | int i = misc->minor; |
248 | 247 | ||
@@ -251,11 +250,7 @@ int __misc_deregister(struct miscdevice *misc, bool suspended) | |||
251 | 250 | ||
252 | mutex_lock(&misc_mtx); | 251 | mutex_lock(&misc_mtx); |
253 | list_del(&misc->list); | 252 | list_del(&misc->list); |
254 | if (suspended) | 253 | device_destroy(misc_class, MKDEV(MISC_MAJOR, misc->minor)); |
255 | destroy_suspended_device(misc_class, | ||
256 | MKDEV(MISC_MAJOR, misc->minor)); | ||
257 | else | ||
258 | device_destroy(misc_class, MKDEV(MISC_MAJOR, misc->minor)); | ||
259 | if (i < DYNAMIC_MINORS && i>0) { | 254 | if (i < DYNAMIC_MINORS && i>0) { |
260 | misc_minors[i>>3] &= ~(1 << (misc->minor & 7)); | 255 | misc_minors[i>>3] &= ~(1 << (misc->minor & 7)); |
261 | } | 256 | } |
@@ -264,7 +259,7 @@ int __misc_deregister(struct miscdevice *misc, bool suspended) | |||
264 | } | 259 | } |
265 | 260 | ||
266 | EXPORT_SYMBOL(misc_register); | 261 | EXPORT_SYMBOL(misc_register); |
267 | EXPORT_SYMBOL(__misc_deregister); | 262 | EXPORT_SYMBOL(misc_deregister); |
268 | 263 | ||
269 | static int __init misc_init(void) | 264 | static int __init misc_init(void) |
270 | { | 265 | { |