From ab386e312e9b9c7f24e4e18e8af2e4630097de3e Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Fri, 6 Dec 2024 15:07:28 +0900 Subject: [PATCH] inform-reboot: Support unload module with exit function Without exit function, reboot notifier is not unregistered, so unloading is failed with busy error. Add exit function unregistering reboot notifier to support unload. Change-Id: Id2fb51f7b6635d0a2bee11ed7ef1bfa96c46ac5c Signed-off-by: Seung-Woo Kim --- kernel/inform-reboot.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kernel/inform-reboot.c b/kernel/inform-reboot.c index c330301..2f96bac 100644 --- a/kernel/inform-reboot.c +++ b/kernel/inform-reboot.c @@ -68,6 +68,12 @@ static int __init inform_reboot_init(void) return 0; } +static void inform_reboot_exit(void) +{ + unregister_reboot_notifier(&nb_inform_reboot_block); +} + subsys_initcall(inform_reboot_init); +module_exit(inform_reboot_exit); MODULE_LICENSE("GPL"); -- 2.34.1