You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
138fe4e069
commit
b844eba292
+4
-9
@@ -232,9 +232,8 @@ int misc_register(struct miscdevice * misc)
|
||||
}
|
||||
|
||||
/**
|
||||
* __misc_deregister - unregister a miscellaneous device
|
||||
* misc_deregister - unregister a miscellaneous device
|
||||
* @misc: device to unregister
|
||||
* @suspended: to be set if the function is used during suspend/resume
|
||||
*
|
||||
* Unregister a miscellaneous device that was previously
|
||||
* successfully registered with misc_register(). Success
|
||||
@@ -242,7 +241,7 @@ int misc_register(struct miscdevice * misc)
|
||||
* indicates an error.
|
||||
*/
|
||||
|
||||
int __misc_deregister(struct miscdevice *misc, bool suspended)
|
||||
int misc_deregister(struct miscdevice *misc)
|
||||
{
|
||||
int i = misc->minor;
|
||||
|
||||
@@ -251,11 +250,7 @@ int __misc_deregister(struct miscdevice *misc, bool suspended)
|
||||
|
||||
mutex_lock(&misc_mtx);
|
||||
list_del(&misc->list);
|
||||
if (suspended)
|
||||
destroy_suspended_device(misc_class,
|
||||
MKDEV(MISC_MAJOR, misc->minor));
|
||||
else
|
||||
device_destroy(misc_class, MKDEV(MISC_MAJOR, misc->minor));
|
||||
device_destroy(misc_class, MKDEV(MISC_MAJOR, misc->minor));
|
||||
if (i < DYNAMIC_MINORS && i>0) {
|
||||
misc_minors[i>>3] &= ~(1 << (misc->minor & 7));
|
||||
}
|
||||
@@ -264,7 +259,7 @@ int __misc_deregister(struct miscdevice *misc, bool suspended)
|
||||
}
|
||||
|
||||
EXPORT_SYMBOL(misc_register);
|
||||
EXPORT_SYMBOL(__misc_deregister);
|
||||
EXPORT_SYMBOL(misc_deregister);
|
||||
|
||||
static int __init misc_init(void)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user