summaryrefslogtreecommitdiffstats
path: root/drivers/watchdog/wdt977.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/wdt977.c
parent01c785dcb4e9fd6c4c370fd9915fc10585ed64bd (diff)
downloadlinux-c6cb13aead3a3cf5bd3e2cfa945602d5cd7825cd.tar.gz
linux-c6cb13aead3a3cf5bd3e2cfa945602d5cd7825cd.tar.bz2
linux-c6cb13aead3a3cf5bd3e2cfa945602d5cd7825cd.zip
[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/wdt977.c')
-rw-r--r--drivers/watchdog/wdt977.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/watchdog/wdt977.c b/drivers/watchdog/wdt977.c
index 9b7f6b6edef6..fb4b876c9fda 100644
--- a/drivers/watchdog/wdt977.c
+++ b/drivers/watchdog/wdt977.c
@@ -470,20 +470,20 @@ static int __init wd977_init(void)
}
}
- rc = misc_register(&wdt977_miscdev);
+ rc = register_reboot_notifier(&wdt977_notifier);
if (rc)
{
- printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
- wdt977_miscdev.minor, rc);
+ printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
+ rc);
goto err_out_region;
}
- rc = register_reboot_notifier(&wdt977_notifier);
+ rc = misc_register(&wdt977_miscdev);
if (rc)
{
- printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
- rc);
- goto err_out_miscdev;
+ printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
+ wdt977_miscdev.minor, rc);
+ goto err_out_reboot;
}
printk(KERN_INFO PFX "initialized. timeout=%d sec (nowayout=%d, testmode=%i)\n",
@@ -491,8 +491,8 @@ static int __init wd977_init(void)
return 0;
-err_out_miscdev:
- misc_deregister(&wdt977_miscdev);
+err_out_reboot:
+ unregister_reboot_notifier(&wdt977_notifier);
err_out_region:
if (!machine_is_netwinder())
release_region(IO_INDEX_PORT,2);