aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog/hpwdt.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/watchdog/hpwdt.c')
-rw-r--r--drivers/watchdog/hpwdt.c24
1 files changed, 6 insertions, 18 deletions
diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c
index 809cbda03d7a..7e7feac05221 100644
--- a/drivers/watchdog/hpwdt.c
+++ b/drivers/watchdog/hpwdt.c
@@ -477,15 +477,11 @@ static int hpwdt_time_left(void)
477/* 477/*
478 * NMI Handler 478 * NMI Handler
479 */ 479 */
480static int hpwdt_pretimeout(struct notifier_block *nb, unsigned long ulReason, 480static int hpwdt_pretimeout(unsigned int ulReason, struct pt_regs *regs)
481 void *data)
482{ 481{
483 unsigned long rom_pl; 482 unsigned long rom_pl;
484 static int die_nmi_called; 483 static int die_nmi_called;
485 484
486 if (ulReason != DIE_NMIUNKNOWN)
487 goto out;
488
489 if (!hpwdt_nmi_decoding) 485 if (!hpwdt_nmi_decoding)
490 goto out; 486 goto out;
491 487
@@ -508,7 +504,7 @@ static int hpwdt_pretimeout(struct notifier_block *nb, unsigned long ulReason,
508 "Management Log for details.\n"); 504 "Management Log for details.\n");
509 505
510out: 506out:
511 return NOTIFY_OK; 507 return NMI_DONE;
512} 508}
513#endif /* CONFIG_HPWDT_NMI_DECODING */ 509#endif /* CONFIG_HPWDT_NMI_DECODING */
514 510
@@ -648,13 +644,6 @@ static struct miscdevice hpwdt_miscdev = {
648 .fops = &hpwdt_fops, 644 .fops = &hpwdt_fops,
649}; 645};
650 646
651#ifdef CONFIG_HPWDT_NMI_DECODING
652static struct notifier_block die_notifier = {
653 .notifier_call = hpwdt_pretimeout,
654 .priority = 0,
655};
656#endif /* CONFIG_HPWDT_NMI_DECODING */
657
658/* 647/*
659 * Init & Exit 648 * Init & Exit
660 */ 649 */
@@ -740,10 +729,9 @@ static int __devinit hpwdt_init_nmi_decoding(struct pci_dev *dev)
740 * die notify list to handle a critical NMI. The default is to 729 * die notify list to handle a critical NMI. The default is to
741 * be last so other users of the NMI signal can function. 730 * be last so other users of the NMI signal can function.
742 */ 731 */
743 if (priority) 732 retval = register_nmi_handler(NMI_UNKNOWN, hpwdt_pretimeout,
744 die_notifier.priority = 0x7FFFFFFF; 733 (priority) ? NMI_FLAG_FIRST : 0,
745 734 "hpwdt");
746 retval = register_die_notifier(&die_notifier);
747 if (retval != 0) { 735 if (retval != 0) {
748 dev_warn(&dev->dev, 736 dev_warn(&dev->dev,
749 "Unable to register a die notifier (err=%d).\n", 737 "Unable to register a die notifier (err=%d).\n",
@@ -763,7 +751,7 @@ static int __devinit hpwdt_init_nmi_decoding(struct pci_dev *dev)
763 751
764static void hpwdt_exit_nmi_decoding(void) 752static void hpwdt_exit_nmi_decoding(void)
765{ 753{
766 unregister_die_notifier(&die_notifier); 754 unregister_nmi_handler(NMI_UNKNOWN, "hpwdt");
767 if (cru_rom_addr) 755 if (cru_rom_addr)
768 iounmap(cru_rom_addr); 756 iounmap(cru_rom_addr);
769} 757}