diff options
Diffstat (limited to 'drivers/watchdog')
101 files changed, 1765 insertions, 2810 deletions
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig index 0e7366dfc90..37096246c93 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig @@ -55,6 +55,7 @@ comment "Watchdog Device Drivers" config SOFT_WATCHDOG tristate "Software watchdog" + select WATCHDOG_CORE help A software monitoring watchdog. This will fail to reboot your system from some situations that the hardware watchdog will recover @@ -74,6 +75,7 @@ config WM831X_WATCHDOG config WM8350_WATCHDOG tristate "WM8350 watchdog" depends on MFD_WM8350 + select WATCHDOG_CORE help Support for the watchdog in the WM8350 AudioPlus PMIC. When the watchdog triggers the system will be reset. @@ -217,6 +219,7 @@ config MPCORE_WATCHDOG config EP93XX_WATCHDOG tristate "EP93xx Watchdog" depends on ARCH_EP93XX + select WATCHDOG_CORE help Say Y here if to include support for the watchdog timer embedded in the Cirrus Logic EP93xx family of devices. @@ -234,6 +237,7 @@ config OMAP_WATCHDOG config PNX4008_WATCHDOG tristate "PNX4008 and LPC32XX Watchdog" depends on ARCH_PNX4008 || ARCH_LPC32XX + select WATCHDOG_CORE help Say Y here if to include support for the watchdog timer in the PNX4008 or LPC32XX processor. @@ -283,6 +287,7 @@ config COH901327_WATCHDOG bool "ST-Ericsson COH 901 327 watchdog" depends on ARCH_U300 default y if MACH_U300 + select WATCHDOG_CORE help Say Y here to include Watchdog timer support for the watchdog embedded into the ST-Ericsson U300 series platforms. @@ -328,6 +333,7 @@ config TS72XX_WATCHDOG config MAX63XX_WATCHDOG tristate "Max63xx watchdog" depends on ARM && HAS_IOMEM + select WATCHDOG_CORE help Support for memory mapped max63{69,70,71,72,73,74} watchdog timer. @@ -955,6 +961,7 @@ config INDYDOG config JZ4740_WDT tristate "Ingenic jz4740 SoC hardware watchdog" depends on MACH_JZ4740 + select WATCHDOG_CORE help Hardware driver for the built-in watchdog timer on Ingenic jz4740 SoCs. @@ -996,6 +1003,7 @@ config AR7_WDT config TXX9_WDT tristate "Toshiba TXx9 Watchdog Timer" depends on CPU_TX39XX || CPU_TX49XX + select WATCHDOG_CORE help Hardware driver for the built-in watchdog timer on TXx9 MIPS SoCs. diff --git a/drivers/watchdog/acquirewdt.c b/drivers/watchdog/acquirewdt.c index b6a2b58cbe6..4397881c83f 100644 --- a/drivers/watchdog/acquirewdt.c +++ b/drivers/watchdog/acquirewdt.c @@ -52,6 +52,8 @@ * Includes, defines, variables, module parameters, ... */ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + /* Includes */ #include <linux/module.h> /* For module specific items */ #include <linux/moduleparam.h> /* For new moduleparam's */ @@ -70,7 +72,6 @@ /* Module information */ #define DRV_NAME "acquirewdt" -#define PFX DRV_NAME ": " #define WATCHDOG_NAME "Acquire WDT" /* There is no way to see what the correct time-out period is */ #define WATCHDOG_HEARTBEAT 0 @@ -92,8 +93,8 @@ static int wdt_start = 0x443; module_param(wdt_start, int, 0); MODULE_PARM_DESC(wdt_start, "Acquire WDT 'start' io port (default 0x443)"); -static int nowayout = WATCHDOG_NOWAYOUT; -module_param(nowayout, int, 0); +static bool nowayout = WATCHDOG_NOWAYOUT; +module_param(nowayout, bool, 0); MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); @@ -208,8 +209,7 @@ static int acq_close(struct inode *inode, struct file *file) if (expect_close == 42) { acq_stop(); } else { - printk(KERN_CRIT PFX - "Unexpected close, not stopping watchdog!\n"); + pr_crit("Unexpected close, not stopping watchdog!\n"); acq_keepalive(); } clear_bit(0, &acq_is_open); @@ -246,27 +246,24 @@ static int __devinit acq_probe(struct platform_device *dev) if (wdt_stop != wdt_start) { if (!request_region(wdt_stop, 1, WATCHDOG_NAME)) { - printk(KERN_ERR PFX - "I/O address 0x%04x already in use\n", wdt_stop); + pr_err("I/O address 0x%04x already in use\n", wdt_stop); ret = -EIO; goto out; } } if (!request_region(wdt_start, 1, WATCHDOG_NAME)) { - printk(KERN_ERR PFX "I/O address 0x%04x already in use\n", - wdt_start); + pr_err("I/O address 0x%04x already in use\n", wdt_start); ret = -EIO; goto unreg_stop; } ret = misc_register(&acq_miscdev); if (ret != 0) { - printk(KERN_ERR PFX - "cannot register miscdev on minor=%d (err=%d)\n", - WATCHDOG_MINOR, ret); + pr_err("cannot register miscdev on minor=%d (err=%d)\n", + WATCHDOG_MINOR, ret); goto unreg_regions; } - printk(KERN_INFO PFX "initialized. (nowayout=%d)\n", nowayout); + pr_info("initialized. (nowayout=%d)\n", nowayout); return 0; unreg_regions: @@ -308,8 +305,7 @@ static int __init acq_init(void) { int err; - printk(KERN_INFO - "WDT driver for Acquire single board computer initialising.\n"); + pr_info("WDT driver for Acquire single board computer initialising\n"); err = platform_driver_register(&acquirewdt_driver); if (err) @@ -332,7 +328,7 @@ static void __exit acq_exit(void) { platform_device_unregister(acq_platform_device); platform_driver_unregister(&acquirewdt_driver); - printk(KERN_INFO PFX "Watchdog Module Unloaded.\n"); + pr_info("Watchdog Module Unloaded\n"); } module_init(acq_init); diff --git a/drivers/watchdog/advantechwdt.c b/drivers/watchdog/advantechwdt.c index 4d40965d2c9..72e81058176 100644 --- a/drivers/watchdog/advantechwdt.c +++ b/drivers/watchdog/advantechwdt.c @@ -28,6 +28,8 @@ * add wdt_start and wdt_stop as parameters. */ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/types.h> @@ -43,7 +45,6 @@ #include <asm/system.h> #define DRV_NAME "advantechwdt" -#define PFX DRV_NAME ": " #define WATCHDOG_NAME "Advantech WDT" #define WATCHDOG_TIMEOUT 60 /* 60 sec default timeout */ @@ -77,8 +78,8 @@ MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. 1<= timeout <=63, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) "."); -static int nowayout = WATCHDOG_NOWAYOUT; -module_param(nowayout, int, 0); +static bool nowayout = WATCHDOG_NOWAYOUT; +module_param(nowayout, bool, 0); MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); @@ -207,8 +208,7 @@ static int advwdt_close(struct inode *inode, struct file *file) if (adv_expect_close == 42) { advwdt_disable(); } else { - printk(KERN_CRIT PFX - "Unexpected close, not stopping watchdog!\n"); + pr_crit("Unexpected close, not stopping watchdog!\n"); advwdt_ping(); } clear_bit(0, &advwdt_is_open); @@ -245,18 +245,15 @@ static int __devinit advwdt_probe(struct platform_device *dev) if (wdt_stop != wdt_start) { if (!request_region(wdt_stop, 1, WATCHDOG_NAME)) { - printk(KERN_ERR PFX - "I/O address 0x%04x already in use\n", - wdt_stop); + pr_err("I/O address 0x%04x already in use\n", + wdt_stop); ret = -EIO; goto out; } } if (!request_region(wdt_start, 1, WATCHDOG_NAME)) { - printk(KERN_ERR PFX - "I/O address 0x%04x already in use\n", - wdt_start); + pr_err("I/O address 0x%04x already in use\n", wdt_start); ret = -EIO; goto unreg_stop; } @@ -265,18 +262,16 @@ static int __devinit advwdt_probe(struct platform_device *dev) * if not reset to the default */ if (advwdt_set_heartbeat(timeout)) { advwdt_set_heartbeat(WATCHDOG_TIMEOUT); - printk(KERN_INFO PFX - "timeout value must be 1<=x<=63, using %d\n", timeout); + pr_info("timeout value must be 1<=x<=63, using %d\n", timeout); } ret = misc_register(&advwdt_miscdev); if (ret != 0) { - printk(KERN_ERR PFX - "cannot register miscdev on minor=%d (err=%d)\n", - WATCHDOG_MINOR, ret); + pr_err("cannot register miscdev on minor=%d (err=%d)\n", + WATCHDOG_MINOR, ret); goto unreg_regions; } - printk(KERN_INFO PFX "initialized. timeout=%d sec (nowayout=%d)\n", + pr_info("initialized. timeout=%d sec (nowayout=%d)\n", timeout, nowayout); out: return ret; @@ -318,8 +313,7 @@ static int __init advwdt_init(void) { int err; - printk(KERN_INFO - "WDT driver for Advantech single board computer initialising.\n"); + pr_info("WDT driver for Advantech single board computer initialising\n"); err = platform_driver_register(&advwdt_driver); if (err) @@ -343,7 +337,7 @@ static void __exit advwdt_exit(void) { platform_device_unregister(advwdt_platform_device); platform_driver_unregister(&advwdt_driver); - printk(KERN_INFO PFX "Watchdog Module Unloaded.\n"); + pr_info("Watchdog Module Unloaded\n"); } module_init(advwdt_init); diff --git a/drivers/watchdog/alim1535_wdt.c b/drivers/watchdog/alim1535_wdt.c index f16dcbd475f..41b84936a52 100644 --- a/drivers/watchdog/alim1535_wdt.c +++ b/drivers/watchdog/alim1535_wdt.c @@ -7,6 +7,8 @@ * 2 of the License, or (at your option) any later version. */ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/types.h> @@ -22,7 +24,6 @@ #include <linux/io.h> #define WATCHDOG_NAME "ALi_M1535" -#define PFX WATCHDOG_NAME ": " #define WATCHDOG_TIMEOUT 60 /* 60 sec default timeout */ /* internal variables */ @@ -39,8 +40,8 @@ MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. (0 < timeout < 18000, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) ")"); -static int nowayout = WATCHDOG_NOWAYOUT; -module_param(nowayout, int, 0); +static bool nowayout = WATCHDOG_NOWAYOUT; +module_param(nowayout, bool, 0); MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); @@ -268,8 +269,7 @@ static int ali_release(struct inode *inode, struct file *file) if (ali_expect_release == 42) ali_stop(); else { - printk(KERN_CRIT PFX - "Unexpected close, not stopping watchdog!\n"); + pr_crit("Unexpected close, not stopping watchdog!\n"); ali_keepalive(); } clear_bit(0, &ali_is_open); @@ -399,9 +399,8 @@ static int __init watchdog_init(void) |