diff options
author | Wim Van Sebroeck <wim@iguana.be> | 2006-08-05 14:59:01 -0400 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2006-10-03 15:35:09 -0400 |
commit | 1bef84bea273f40486936ae97cda70ee8b252cd0 (patch) | |
tree | 7f1a9cd2972f9201f7f79c73ca8aa92db6e78be0 /drivers | |
parent | 4802c6533af3223f43b9e4a1bb8a2a1c51f398b1 (diff) |
[WATCHDOG] iTCO_wdt.c shutdown patch
Since we are using the device driver model,
we don't need to arrange the shutdown via a
reboot_notifier.
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/char/watchdog/iTCO_wdt.c | 37 |
1 files changed, 4 insertions, 33 deletions
diff --git a/drivers/char/watchdog/iTCO_wdt.c b/drivers/char/watchdog/iTCO_wdt.c index 852ad8389bc7..ebd3fc8000e5 100644 --- a/drivers/char/watchdog/iTCO_wdt.c +++ b/drivers/char/watchdog/iTCO_wdt.c | |||
@@ -45,7 +45,7 @@ | |||
45 | /* Module and version information */ | 45 | /* Module and version information */ |
46 | #define DRV_NAME "iTCO_wdt" | 46 | #define DRV_NAME "iTCO_wdt" |
47 | #define DRV_VERSION "1.00" | 47 | #define DRV_VERSION "1.00" |
48 | #define DRV_RELDATE "19-Jul-2006" | 48 | #define DRV_RELDATE "30-Jul-2006" |
49 | #define PFX DRV_NAME ": " | 49 | #define PFX DRV_NAME ": " |
50 | 50 | ||
51 | /* Includes */ | 51 | /* Includes */ |
@@ -57,8 +57,6 @@ | |||
57 | #include <linux/kernel.h> /* For printk/panic/... */ | 57 | #include <linux/kernel.h> /* For printk/panic/... */ |
58 | #include <linux/miscdevice.h> /* For MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR) */ | 58 | #include <linux/miscdevice.h> /* For MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR) */ |
59 | #include <linux/watchdog.h> /* For the watchdog specific items */ | 59 | #include <linux/watchdog.h> /* For the watchdog specific items */ |
60 | #include <linux/notifier.h> /* For notifier support */ | ||
61 | #include <linux/reboot.h> /* For reboot_notifier stuff */ | ||
62 | #include <linux/init.h> /* For __init/__exit/... */ | 60 | #include <linux/init.h> /* For __init/__exit/... */ |
63 | #include <linux/fs.h> /* For file operations */ | 61 | #include <linux/fs.h> /* For file operations */ |
64 | #include <linux/platform_device.h> /* For platform_driver framework */ | 62 | #include <linux/platform_device.h> /* For platform_driver framework */ |
@@ -501,20 +499,6 @@ static int iTCO_wdt_ioctl (struct inode *inode, struct file *file, | |||
501 | } | 499 | } |
502 | 500 | ||
503 | /* | 501 | /* |
504 | * Notify system | ||
505 | */ | ||
506 | |||
507 | static int iTCO_wdt_notify_sys (struct notifier_block *this, unsigned long code, void *unused) | ||
508 | { | ||
509 | if (code==SYS_DOWN || code==SYS_HALT) { | ||
510 | /* Turn the WDT off */ | ||
511 | iTCO_wdt_stop(); | ||
512 | } | ||
513 | |||
514 | return NOTIFY_DONE; | ||
515 | } | ||
516 | |||
517 | /* | ||
518 | * Kernel Interfaces | 502 | * Kernel Interfaces |
519 | */ | 503 | */ |
520 | 504 | ||
@@ -533,10 +517,6 @@ static struct miscdevice iTCO_wdt_miscdev = { | |||
533 | .fops = &iTCO_wdt_fops, | 517 | .fops = &iTCO_wdt_fops, |
534 | }; | 518 | }; |
535 | 519 | ||
536 | static struct notifier_block iTCO_wdt_notifier = { | ||
537 | .notifier_call = iTCO_wdt_notify_sys, | ||
538 | }; | ||
539 | |||
540 | /* | 520 | /* |
541 | * Init & exit routines | 521 | * Init & exit routines |
542 | */ | 522 | */ |
@@ -623,18 +603,11 @@ static int iTCO_wdt_init(struct pci_dev *pdev, const struct pci_device_id *ent, | |||
623 | heartbeat); | 603 | heartbeat); |
624 | } | 604 | } |
625 | 605 | ||
626 | ret = register_reboot_notifier(&iTCO_wdt_notifier); | ||
627 | if (ret != 0) { | ||
628 | printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n", | ||
629 | ret); | ||
630 | goto unreg_region; | ||
631 | } | ||
632 | |||
633 | ret = misc_register(&iTCO_wdt_miscdev); | 606 | ret = misc_register(&iTCO_wdt_miscdev); |
634 | if (ret != 0) { | 607 | if (ret != 0) { |
635 | printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n", | 608 | printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n", |
636 | WATCHDOG_MINOR, ret); | 609 | WATCHDOG_MINOR, ret); |
637 | goto unreg_notifier; | 610 | goto unreg_region; |
638 | } | 611 | } |
639 | 612 | ||
640 | printk (KERN_INFO PFX "initialized. heartbeat=%d sec (nowayout=%d)\n", | 613 | printk (KERN_INFO PFX "initialized. heartbeat=%d sec (nowayout=%d)\n", |
@@ -642,15 +615,13 @@ static int iTCO_wdt_init(struct pci_dev *pdev, const struct pci_device_id *ent, | |||
642 | 615 | ||
643 | return 0; | 616 | return 0; |
644 | 617 | ||
645 | unreg_notifier: | ||
646 | unregister_reboot_notifier(&iTCO_wdt_notifier); | ||
647 | unreg_region: | 618 | unreg_region: |
648 | release_region (TCOBASE, 0x20); | 619 | release_region (TCOBASE, 0x20); |
649 | out: | 620 | out: |
650 | if (iTCO_wdt_private.iTCO_version == 2) | 621 | if (iTCO_wdt_private.iTCO_version == 2) |
651 | iounmap(iTCO_wdt_private.gcs); | 622 | iounmap(iTCO_wdt_private.gcs); |
652 | iTCO_wdt_private.ACPIBASE = 0; | ||
653 | pci_dev_put(iTCO_wdt_private.pdev); | 623 | pci_dev_put(iTCO_wdt_private.pdev); |
624 | iTCO_wdt_private.ACPIBASE = 0; | ||
654 | return ret; | 625 | return ret; |
655 | } | 626 | } |
656 | 627 | ||
@@ -662,11 +633,11 @@ static void iTCO_wdt_cleanup(void) | |||
662 | 633 | ||
663 | /* Deregister */ | 634 | /* Deregister */ |
664 | misc_deregister(&iTCO_wdt_miscdev); | 635 | misc_deregister(&iTCO_wdt_miscdev); |
665 | unregister_reboot_notifier(&iTCO_wdt_notifier); | ||
666 | release_region(TCOBASE, 0x20); | 636 | release_region(TCOBASE, 0x20); |
667 | if (iTCO_wdt_private.iTCO_version == 2) | 637 | if (iTCO_wdt_private.iTCO_version == 2) |
668 | iounmap(iTCO_wdt_private.gcs); | 638 | iounmap(iTCO_wdt_private.gcs); |
669 | pci_dev_put(iTCO_wdt_private.pdev); | 639 | pci_dev_put(iTCO_wdt_private.pdev); |
640 | iTCO_wdt_private.ACPIBASE = 0; | ||
670 | } | 641 | } |
671 | 642 | ||
672 | static int iTCO_wdt_probe(struct platform_device *dev) | 643 | static int iTCO_wdt_probe(struct platform_device *dev) |