mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-26 14:17:26 -04:00
Misc: Add possibility to remove misc devices during suspend/resume
Make it possible to unregister a misc device object in a safe way during a suspend/resume cycle. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Cc: Michael Buesch <mb@bu3sch.de> Cc: Pavel Machek <pavel@ucw.cz> Cc: "John W. Linville" <linville@tuxdriver.com> Cc: Alan Stern <stern@rowland.harvard.edu> Cc: Len Brown <lenb@kernel.org> Cc: Greg KH <greg@kroah.com> Cc: Kay Sievers <kay.sievers@vrfy.org> Cc: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
f011e2e2df
commit
533354d4ac
2 changed files with 18 additions and 5 deletions
|
@ -43,7 +43,15 @@ struct miscdevice {
|
|||
};
|
||||
|
||||
extern int misc_register(struct miscdevice * misc);
|
||||
extern int misc_deregister(struct miscdevice * misc);
|
||||
extern int __misc_deregister(struct miscdevice *misc, bool suspended);
|
||||
static inline int misc_deregister(struct miscdevice *misc)
|
||||
{
|
||||
return __misc_deregister(misc, false);
|
||||
}
|
||||
static inline int misc_deregister_suspended(struct miscdevice *misc)
|
||||
{
|
||||
return __misc_deregister(misc, true);
|
||||
}
|
||||
|
||||
#define MODULE_ALIAS_MISCDEV(minor) \
|
||||
MODULE_ALIAS("char-major-" __stringify(MISC_MAJOR) \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue