diff options
author | Wim Van Sebroeck <wim@iguana.be> | 2007-12-26 15:32:51 -0500 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2008-01-25 15:31:50 -0500 |
commit | c6cb13aead3a3cf5bd3e2cfa945602d5cd7825cd (patch) | |
tree | ecff4a444e33d0ca24925e92fee4f9021ba981b8 /drivers/watchdog/w83877f_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/w83877f_wdt.c')
-rw-r--r-- | drivers/watchdog/w83877f_wdt.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/watchdog/w83877f_wdt.c b/drivers/watchdog/w83877f_wdt.c index bcc9d48955de..f510a3a595e6 100644 --- a/drivers/watchdog/w83877f_wdt.c +++ b/drivers/watchdog/w83877f_wdt.c | |||
@@ -373,20 +373,20 @@ static int __init w83877f_wdt_init(void) | |||
373 | goto err_out_region1; | 373 | goto err_out_region1; |
374 | } | 374 | } |
375 | 375 | ||
376 | rc = misc_register(&wdt_miscdev); | 376 | rc = register_reboot_notifier(&wdt_notifier); |
377 | if (rc) | 377 | if (rc) |
378 | { | 378 | { |
379 | printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n", | 379 | printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n", |
380 | wdt_miscdev.minor, rc); | 380 | rc); |
381 | goto err_out_region2; | 381 | goto err_out_region2; |
382 | } | 382 | } |
383 | 383 | ||
384 | rc = register_reboot_notifier(&wdt_notifier); | 384 | rc = misc_register(&wdt_miscdev); |
385 | if (rc) | 385 | if (rc) |
386 | { | 386 | { |
387 | printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n", | 387 | printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n", |
388 | rc); | 388 | wdt_miscdev.minor, rc); |
389 | goto err_out_miscdev; | 389 | goto err_out_reboot; |
390 | } | 390 | } |
391 | 391 | ||
392 | printk(KERN_INFO PFX "WDT driver for W83877F initialised. timeout=%d sec (nowayout=%d)\n", | 392 | printk(KERN_INFO PFX "WDT driver for W83877F initialised. timeout=%d sec (nowayout=%d)\n", |
@@ -394,8 +394,8 @@ static int __init w83877f_wdt_init(void) | |||
394 | 394 | ||
395 | return 0; | 395 | return 0; |
396 | 396 | ||
397 | err_out_miscdev: | 397 | err_out_reboot: |
398 | misc_deregister(&wdt_miscdev); | 398 | unregister_reboot_notifier(&wdt_notifier); |
399 | err_out_region2: | 399 | err_out_region2: |
400 | release_region(WDT_PING,1); | 400 | release_region(WDT_PING,1); |
401 | err_out_region1: | 401 | err_out_region1: |