diff options
author | Andrey Smirnov <andrew.smirnov@gmail.com> | 2017-11-17 15:30:57 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-11-17 16:10:04 -0800 |
commit | 2d8364bae4db144df75ba85e92d2b8619ba8eedc (patch) | |
tree | fde83e8f69dbf7b69ce7ba4c5abfe9252eac9db7 /include/linux/reboot.h | |
parent | c512ac01d8a841033da8ec538a83f80fb0b4d1fe (diff) | |
download | linux-2d8364bae4db144df75ba85e92d2b8619ba8eedc.tar.gz linux-2d8364bae4db144df75ba85e92d2b8619ba8eedc.tar.bz2 linux-2d8364bae4db144df75ba85e92d2b8619ba8eedc.zip |
kernel/reboot.c: add devm_register_reboot_notifier()
Add devm_* wrapper around register_reboot_notifier to simplify device
specific reboot notifier registration/unregistration.
[akpm@linux-foundation.org: move `struct device' forward decl to top-of-file]
Link: http://lkml.kernel.org/r/20170320171753.1705-1-andrew.smirnov@gmail.com
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/reboot.h')
-rw-r--r-- | include/linux/reboot.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/reboot.h b/include/linux/reboot.h index d03da0eb95ca..e63799a6e895 100644 --- a/include/linux/reboot.h +++ b/include/linux/reboot.h @@ -6,6 +6,8 @@ #include <linux/notifier.h> #include <uapi/linux/reboot.h> +struct device; + #define SYS_DOWN 0x0001 /* Notify of system down */ #define SYS_RESTART SYS_DOWN #define SYS_HALT 0x0002 /* Notify of system halt */ @@ -39,6 +41,8 @@ extern int reboot_force; extern int register_reboot_notifier(struct notifier_block *); extern int unregister_reboot_notifier(struct notifier_block *); +extern int devm_register_reboot_notifier(struct device *, struct notifier_block *); + extern int register_restart_handler(struct notifier_block *); extern int unregister_restart_handler(struct notifier_block *); extern void do_kernel_restart(char *cmd); |