aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog/it87_wdt.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/watchdog/it87_wdt.c')
-rw-r--r--drivers/watchdog/it87_wdt.c47
1 files changed, 19 insertions, 28 deletions
diff --git a/drivers/watchdog/it87_wdt.c b/drivers/watchdog/it87_wdt.c
index a2d9a1266a23..8a741bcb5124 100644
--- a/drivers/watchdog/it87_wdt.c
+++ b/drivers/watchdog/it87_wdt.c
@@ -29,6 +29,8 @@
29 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 29 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
30 */ 30 */
31 31
32#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
33
32#include <linux/module.h> 34#include <linux/module.h>
33#include <linux/moduleparam.h> 35#include <linux/moduleparam.h>
34#include <linux/types.h> 36#include <linux/types.h>
@@ -43,11 +45,9 @@
43#include <linux/uaccess.h> 45#include <linux/uaccess.h>
44#include <linux/io.h> 46#include <linux/io.h>
45 47
46#include <asm/system.h>
47 48
48#define WATCHDOG_VERSION "1.14" 49#define WATCHDOG_VERSION "1.14"
49#define WATCHDOG_NAME "IT87 WDT" 50#define WATCHDOG_NAME "IT87 WDT"
50#define PFX WATCHDOG_NAME ": "
51#define DRIVER_VERSION WATCHDOG_NAME " driver, v" WATCHDOG_VERSION "\n" 51#define DRIVER_VERSION WATCHDOG_NAME " driver, v" WATCHDOG_VERSION "\n"
52#define WD_MAGIC 'V' 52#define WD_MAGIC 'V'
53 53
@@ -142,7 +142,7 @@ static int nogameport = DEFAULT_NOGAMEPORT;
142static int exclusive = DEFAULT_EXCLUSIVE; 142static int exclusive = DEFAULT_EXCLUSIVE;
143static int timeout = DEFAULT_TIMEOUT; 143static int timeout = DEFAULT_TIMEOUT;
144static int testmode = DEFAULT_TESTMODE; 144static int testmode = DEFAULT_TESTMODE;
145static int nowayout = DEFAULT_NOWAYOUT; 145static bool nowayout = DEFAULT_NOWAYOUT;
146 146
147module_param(nogameport, int, 0); 147module_param(nogameport, int, 0);
148MODULE_PARM_DESC(nogameport, "Forbid the activation of game port, default=" 148MODULE_PARM_DESC(nogameport, "Forbid the activation of game port, default="
@@ -156,7 +156,7 @@ MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds, default="
156module_param(testmode, int, 0); 156module_param(testmode, int, 0);
157MODULE_PARM_DESC(testmode, "Watchdog test mode (1 = no reboot), default=" 157MODULE_PARM_DESC(testmode, "Watchdog test mode (1 = no reboot), default="
158 __MODULE_STRING(DEFAULT_TESTMODE)); 158 __MODULE_STRING(DEFAULT_TESTMODE));
159module_param(nowayout, int, 0); 159module_param(nowayout, bool, 0);
160MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started, default=" 160MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started, default="
161 __MODULE_STRING(WATCHDOG_NOWAYOUT)); 161 __MODULE_STRING(WATCHDOG_NOWAYOUT));
162 162
@@ -428,8 +428,7 @@ static int wdt_release(struct inode *inode, struct file *file)
428 clear_bit(WDTS_TIMER_RUN, &wdt_status); 428 clear_bit(WDTS_TIMER_RUN, &wdt_status);
429 } else { 429 } else {
430 wdt_keepalive(); 430 wdt_keepalive();
431 printk(KERN_CRIT PFX 431 pr_crit("unexpected close, not stopping watchdog!\n");
432 "unexpected close, not stopping watchdog!\n");
433 } 432 }
434 } 433 }
435 clear_bit(WDTS_DEV_OPEN, &wdt_status); 434 clear_bit(WDTS_DEV_OPEN, &wdt_status);
@@ -621,16 +620,14 @@ static int __init it87_wdt_init(void)
621 try_gameport = 0; 620 try_gameport = 0;
622 break; 621 break;
623 case IT8705_ID: 622 case IT8705_ID:
624 printk(KERN_ERR PFX 623 pr_err("Unsupported Chip found, Chip %04x Revision %02x\n",
625 "Unsupported Chip found, Chip %04x Revision %02x\n",
626 chip_type, chip_rev); 624 chip_type, chip_rev);
627 return -ENODEV; 625 return -ENODEV;
628 case NO_DEV_ID: 626 case NO_DEV_ID:
629 printk(KERN_ERR PFX "no device\n"); 627 pr_err("no device\n");
630 return -ENODEV; 628 return -ENODEV;
631 default: 629 default:
632 printk(KERN_ERR PFX 630 pr_err("Unknown Chip found, Chip %04x Revision %04x\n",
633 "Unknown Chip found, Chip %04x Revision %04x\n",
634 chip_type, chip_rev); 631 chip_type, chip_rev);
635 return -ENODEV; 632 return -ENODEV;
636 } 633 }
@@ -663,13 +660,11 @@ static int __init it87_wdt_init(void)
663 if (!test_bit(WDTS_USE_GP, &wdt_status)) { 660 if (!test_bit(WDTS_USE_GP, &wdt_status)) {
664 if (!request_region(CIR_BASE, 8, WATCHDOG_NAME)) { 661 if (!request_region(CIR_BASE, 8, WATCHDOG_NAME)) {
665 if (gp_rreq_fail) 662 if (gp_rreq_fail)
666 printk(KERN_ERR PFX 663 pr_err("I/O Address 0x%04x and 0x%04x already in use\n",
667 "I/O Address 0x%04x and 0x%04x" 664 base, CIR_BASE);
668 " already in use\n", base, CIR_BASE);
669 else 665 else
670 printk(KERN_ERR PFX 666 pr_err("I/O Address 0x%04x already in use\n",
671 "I/O Address 0x%04x already in use\n", 667 CIR_BASE);
672 CIR_BASE);
673 rc = -EIO; 668 rc = -EIO;
674 goto err_out; 669 goto err_out;
675 } 670 }
@@ -688,9 +683,8 @@ static int __init it87_wdt_init(void)
688 683
689 if (timeout < 1 || timeout > max_units * 60) { 684 if (timeout < 1 || timeout > max_units * 60) {
690 timeout = DEFAULT_TIMEOUT; 685 timeout = DEFAULT_TIMEOUT;
691 printk(KERN_WARNING PFX 686 pr_warn("Timeout value out of range, use default %d sec\n",
692 "Timeout value out of range, use default %d sec\n", 687 DEFAULT_TIMEOUT);
693 DEFAULT_TIMEOUT);
694 } 688 }
695 689
696 if (timeout > max_units) 690 if (timeout > max_units)
@@ -698,16 +692,14 @@ static int __init it87_wdt_init(void)
698 692
699 rc = register_reboot_notifier(&wdt_notifier); 693 rc = register_reboot_notifier(&wdt_notifier);
700 if (rc) { 694 if (rc) {
701 printk(KERN_ERR PFX 695 pr_err("Cannot register reboot notifier (err=%d)\n", rc);
702 "Cannot register reboot notifier (err=%d)\n", rc);
703 goto err_out_region; 696 goto err_out_region;
704 } 697 }
705 698
706 rc = misc_register(&wdt_miscdev); 699 rc = misc_register(&wdt_miscdev);
707 if (rc) { 700 if (rc) {
708 printk(KERN_ERR PFX 701 pr_err("Cannot register miscdev on minor=%d (err=%d)\n",
709 "Cannot register miscdev on minor=%d (err=%d)\n", 702 wdt_miscdev.minor, rc);
710 wdt_miscdev.minor, rc);
711 goto err_out_reboot; 703 goto err_out_reboot;
712 } 704 }
713 705
@@ -722,9 +714,8 @@ static int __init it87_wdt_init(void)
722 outb(0x09, CIR_IER(base)); 714 outb(0x09, CIR_IER(base));
723 } 715 }
724 716
725 printk(KERN_INFO PFX "Chip IT%04x revision %d initialized. " 717 pr_info("Chip IT%04x revision %d initialized. timeout=%d sec (nowayout=%d testmode=%d exclusive=%d nogameport=%d)\n",
726 "timeout=%d sec (nowayout=%d testmode=%d exclusive=%d " 718 chip_type, chip_rev, timeout,
727 "nogameport=%d)\n", chip_type, chip_rev, timeout,
728 nowayout, testmode, exclusive, nogameport); 719 nowayout, testmode, exclusive, nogameport);
729 720
730 superio_exit(); 721 superio_exit();