aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog/w83977f_wdt.c
diff options
context:
space:
mode:
authorWim Van Sebroeck <wim@iguana.be>2007-12-26 15:32:51 -0500
committerWim Van Sebroeck <wim@iguana.be>2008-01-25 15:31:50 -0500
commitc6cb13aead3a3cf5bd3e2cfa945602d5cd7825cd (patch)
treeecff4a444e33d0ca24925e92fee4f9021ba981b8 /drivers/watchdog/w83977f_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/w83977f_wdt.c')
-rw-r--r--drivers/watchdog/w83977f_wdt.c18
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)
494 goto err_out; 494 goto err_out;
495 } 495 }
496 496
497 rc = misc_register(&wdt_miscdev); 497 rc = register_reboot_notifier(&wdt_notifier);
498 if (rc) 498 if (rc)
499 { 499 {
500 printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n", 500 printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
501 wdt_miscdev.minor, rc); 501 rc);
502 goto err_out_region; 502 goto err_out_region;
503 } 503 }
504 504
505 rc = register_reboot_notifier(&wdt_notifier); 505 rc = misc_register(&wdt_miscdev);
506 if (rc) 506 if (rc)
507 { 507 {
508 printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n", 508 printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
509 rc); 509 wdt_miscdev.minor, rc);
510 goto err_out_miscdev; 510 goto err_out_reboot;
511 } 511 }
512 512
513 printk(KERN_INFO PFX "initialized. timeout=%d sec (nowayout=%d testmode=%d)\n", 513 printk(KERN_INFO PFX "initialized. timeout=%d sec (nowayout=%d testmode=%d)\n",
@@ -515,8 +515,8 @@ static int __init w83977f_wdt_init(void)
515 515
516 return 0; 516 return 0;
517 517
518err_out_miscdev: 518err_out_reboot:
519 misc_deregister(&wdt_miscdev); 519 unregister_reboot_notifier(&wdt_notifier);
520err_out_region: 520err_out_region:
521 release_region(IO_INDEX_PORT,2); 521 release_region(IO_INDEX_PORT,2);
522err_out: 522err_out: