aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog/wdt977.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/wdt977.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/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)
470 } 470 }
471 } 471 }
472 472
473 rc = misc_register(&wdt977_miscdev); 473 rc = register_reboot_notifier(&wdt977_notifier);
474 if (rc) 474 if (rc)
475 { 475 {
476 printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n", 476 printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
477 wdt977_miscdev.minor, rc); 477 rc);
478 goto err_out_region; 478 goto err_out_region;
479 } 479 }
480 480
481 rc = register_reboot_notifier(&wdt977_notifier); 481 rc = misc_register(&wdt977_miscdev);
482 if (rc) 482 if (rc)
483 { 483 {
484 printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n", 484 printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
485 rc); 485 wdt977_miscdev.minor, rc);
486 goto err_out_miscdev; 486 goto err_out_reboot;
487 } 487 }
488 488
489 printk(KERN_INFO PFX "initialized. timeout=%d sec (nowayout=%d, testmode=%i)\n", 489 printk(KERN_INFO PFX "initialized. timeout=%d sec (nowayout=%d, testmode=%i)\n",
@@ -491,8 +491,8 @@ static int __init wd977_init(void)
491 491
492 return 0; 492 return 0;
493 493
494err_out_miscdev: 494err_out_reboot:
495 misc_deregister(&wdt977_miscdev); 495 unregister_reboot_notifier(&wdt977_notifier);
496err_out_region: 496err_out_region:
497 if (!machine_is_netwinder()) 497 if (!machine_is_netwinder())
498 release_region(IO_INDEX_PORT,2); 498 release_region(IO_INDEX_PORT,2);