diff options
author | Wim Van Sebroeck <wim@iguana.be> | 2007-12-26 20:32:51 +0000 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2008-01-25 20:31:50 +0000 |
commit | c6cb13aead3a3cf5bd3e2cfa945602d5cd7825cd (patch) | |
tree | ecff4a444e33d0ca24925e92fee4f9021ba981b8 /drivers/watchdog/w83977f_wdt.c | |
parent | 01c785dcb4e9fd6c4c370fd9915fc10585ed64bd (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/w83977f_wdt.c')
-rw-r--r-- | drivers/watchdog/w83977f_wdt.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/watchdog/w83977f_wdt.c b/drivers/watchdog/w83977f_wdt.c index b475529d2475..b209bcd7f789 100644 --- a/drivers/watchdog/w83977f_wdt.c +++ b/drivers/watchdog/w83977f_wdt.c @@ -494,20 +494,20 @@ static int __init w83977f_wdt_init(void) goto err_out; } - rc = misc_register(&wdt_miscdev); + rc = register_reboot_notifier(&wdt_notifier); if (rc) { - printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n", - wdt_miscdev.minor, rc); + printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n", + rc); goto err_out_region; } - rc = register_reboot_notifier(&wdt_notifier); + rc = misc_register(&wdt_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", + wdt_miscdev.minor, rc); + goto err_out_reboot; } printk(KERN_INFO PFX "initialized. timeout=%d sec (nowayout=%d testmode=%d)\n", @@ -515,8 +515,8 @@ static int __init w83977f_wdt_init(void) return 0; -err_out_miscdev: - misc_deregister(&wdt_miscdev); +err_out_reboot: + unregister_reboot_notifier(&wdt_notifier); err_out_region: release_region(IO_INDEX_PORT,2); err_out: |