summaryrefslogtreecommitdiff
path: root/drivers/watchdog/scx200_wdt.c
diff options
context:
space:
mode:
authorWim Van Sebroeck <wim@iguana.be>2007-12-26 20:32:51 +0000
committerWim Van Sebroeck <wim@iguana.be>2008-01-25 20:31:50 +0000
commitc6cb13aead3a3cf5bd3e2cfa945602d5cd7825cd (patch)
treeecff4a444e33d0ca24925e92fee4f9021ba981b8 /drivers/watchdog/scx200_wdt.c
parent01c785dcb4e9fd6c4c370fd9915fc10585ed64bd (diff)
[WATCHDOG] misc_register patch
Make sure that we first do a register_reboot_notifier before we do a misc_register. A misc_register opens the interface to userspace and it's best to do this as the last action. Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/watchdog/scx200_wdt.c')
-rw-r--r--drivers/watchdog/scx200_wdt.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/watchdog/scx200_wdt.c b/drivers/watchdog/scx200_wdt.c
index d4fd0fa2f176..d55882bca319 100644
--- a/drivers/watchdog/scx200_wdt.c
+++ b/drivers/watchdog/scx200_wdt.c
@@ -231,17 +231,17 @@ static int __init scx200_wdt_init(void)
sema_init(&open_semaphore, 1);
- r = misc_register(&scx200_wdt_miscdev);
+ r = register_reboot_notifier(&scx200_wdt_notifier);
if (r) {
+ printk(KERN_ERR NAME ": unable to register reboot notifier");
release_region(scx200_cb_base + SCx200_WDT_OFFSET,
SCx200_WDT_SIZE);
return r;
}
- r = register_reboot_notifier(&scx200_wdt_notifier);
+ r = misc_register(&scx200_wdt_miscdev);
if (r) {
- printk(KERN_ERR NAME ": unable to register reboot notifier");
- misc_deregister(&scx200_wdt_miscdev);
+ unregister_reboot_notifier(&scx200_wdt_notifier);
release_region(scx200_cb_base + SCx200_WDT_OFFSET,
SCx200_WDT_SIZE);
return r;
@@ -252,8 +252,8 @@ static int __init scx200_wdt_init(void)
static void __exit scx200_wdt_cleanup(void)
{
- unregister_reboot_notifier(&scx200_wdt_notifier);
misc_deregister(&scx200_wdt_miscdev);
+ unregister_reboot_notifier(&scx200_wdt_notifier);
release_region(scx200_cb_base + SCx200_WDT_OFFSET,
SCx200_WDT_SIZE);
}