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.c42
1 files changed, 17 insertions, 25 deletions
diff --git a/drivers/watchdog/it87_wdt.c b/drivers/watchdog/it87_wdt.c
index a2d9a1266a23..86b368857ce2 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>
@@ -47,7 +49,6 @@
47 49
48#define WATCHDOG_VERSION "1.14" 50#define WATCHDOG_VERSION "1.14"
49#define WATCHDOG_NAME "IT87 WDT" 51#define WATCHDOG_NAME "IT87 WDT"
50#define PFX WATCHDOG_NAME ": "
51#define DRIVER_VERSION WATCHDOG_NAME " driver, v" WATCHDOG_VERSION "\n" 52#define DRIVER_VERSION WATCHDOG_NAME " driver, v" WATCHDOG_VERSION "\n"
52#define WD_MAGIC 'V' 53#define WD_MAGIC 'V'
53 54
@@ -428,8 +429,7 @@ static int wdt_release(struct inode *inode, struct file *file)
428 clear_bit(WDTS_TIMER_RUN, &wdt_status); 429 clear_bit(WDTS_TIMER_RUN, &wdt_status);
429 } else { 430 } else {
430 wdt_keepalive(); 431 wdt_keepalive();
431 printk(KERN_CRIT PFX 432 pr_crit("unexpected close, not stopping watchdog!\n");
432 "unexpected close, not stopping watchdog!\n");
433 } 433 }
434 } 434 }
435 clear_bit(WDTS_DEV_OPEN, &wdt_status); 435 clear_bit(WDTS_DEV_OPEN, &wdt_status);
@@ -621,16 +621,14 @@ static int __init it87_wdt_init(void)
621 try_gameport = 0; 621 try_gameport = 0;
622 break; 622 break;
623 case IT8705_ID: 623 case IT8705_ID:
624 printk(KERN_ERR PFX 624 pr_err("Unsupported Chip found, Chip %04x Revision %02x\n",
625 "Unsupported Chip found, Chip %04x Revision %02x\n",
626 chip_type, chip_rev); 625 chip_type, chip_rev);
627 return -ENODEV; 626 return -ENODEV;
628 case NO_DEV_ID: 627 case NO_DEV_ID:
629 printk(KERN_ERR PFX "no device\n"); 628 pr_err("no device\n");
630 return -ENODEV; 629 return -ENODEV;
631 default: 630 default:
632 printk(KERN_ERR PFX 631 pr_err("Unknown Chip found, Chip %04x Revision %04x\n",
633 "Unknown Chip found, Chip %04x Revision %04x\n",
634 chip_type, chip_rev); 632 chip_type, chip_rev);
635 return -ENODEV; 633 return -ENODEV;
636 } 634 }
@@ -663,13 +661,11 @@ static int __init it87_wdt_init(void)
663 if (!test_bit(WDTS_USE_GP, &wdt_status)) { 661 if (!test_bit(WDTS_USE_GP, &wdt_status)) {
664 if (!request_region(CIR_BASE, 8, WATCHDOG_NAME)) { 662 if (!request_region(CIR_BASE, 8, WATCHDOG_NAME)) {
665 if (gp_rreq_fail) 663 if (gp_rreq_fail)
666 printk(KERN_ERR PFX 664 pr_err("I/O Address 0x%04x and 0x%04x already in use\n",
667 "I/O Address 0x%04x and 0x%04x" 665 base, CIR_BASE);
668 " already in use\n", base, CIR_BASE);
669 else 666 else
670 printk(KERN_ERR PFX 667 pr_err("I/O Address 0x%04x already in use\n",
671 "I/O Address 0x%04x already in use\n", 668 CIR_BASE);
672 CIR_BASE);
673 rc = -EIO; 669 rc = -EIO;
674 goto err_out; 670 goto err_out;
675 } 671 }
@@ -688,9 +684,8 @@ static int __init it87_wdt_init(void)
688 684
689 if (timeout < 1 || timeout > max_units * 60) { 685 if (timeout < 1 || timeout > max_units * 60) {
690 timeout = DEFAULT_TIMEOUT; 686 timeout = DEFAULT_TIMEOUT;
691 printk(KERN_WARNING PFX 687 pr_warn("Timeout value out of range, use default %d sec\n",
692 "Timeout value out of range, use default %d sec\n", 688 DEFAULT_TIMEOUT);
693 DEFAULT_TIMEOUT);
694 } 689 }
695 690
696 if (timeout > max_units) 691 if (timeout > max_units)
@@ -698,16 +693,14 @@ static int __init it87_wdt_init(void)
698 693
699 rc = register_reboot_notifier(&wdt_notifier); 694 rc = register_reboot_notifier(&wdt_notifier);
700 if (rc) { 695 if (rc) {
701 printk(KERN_ERR PFX 696 pr_err("Cannot register reboot notifier (err=%d)\n", rc);
702 "Cannot register reboot notifier (err=%d)\n", rc);
703 goto err_out_region; 697 goto err_out_region;
704 } 698 }
705 699
706 rc = misc_register(&wdt_miscdev); 700 rc = misc_register(&wdt_miscdev);
707 if (rc) { 701 if (rc) {
708 printk(KERN_ERR PFX 702 pr_err("Cannot register miscdev on minor=%d (err=%d)\n",
709 "Cannot register miscdev on minor=%d (err=%d)\n", 703 wdt_miscdev.minor, rc);
710 wdt_miscdev.minor, rc);
711 goto err_out_reboot; 704 goto err_out_reboot;
712 } 705 }
713 706
@@ -722,9 +715,8 @@ static int __init it87_wdt_init(void)
722 outb(0x09, CIR_IER(base)); 715 outb(0x09, CIR_IER(base));
723 } 716 }
724 717
725 printk(KERN_INFO PFX "Chip IT%04x revision %d initialized. " 718 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 " 719 chip_type, chip_rev, timeout,
727 "nogameport=%d)\n", chip_type, chip_rev, timeout,
728 nowayout, testmode, exclusive, nogameport); 720 nowayout, testmode, exclusive, nogameport);
729 721
730 superio_exit(); 722 superio_exit();