diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-28 13:03:26 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-28 13:03:26 -0700 |
commit | 750f77064a290beb162352077b52c61b04bcae0e (patch) | |
tree | 736a8dd043dc4cda298762a80e7c1fbf1bb87742 /drivers/watchdog/wdt.c | |
parent | 89e5d6f0d979f6e7dc2bbb1ebd9e239217e2e952 (diff) | |
parent | b92c803ec61de59e6e4ab9b2748d8e633cec3f08 (diff) | |
download | linux-750f77064a290beb162352077b52c61b04bcae0e.tar.bz2 |
Merge git://www.linux-watchdog.org/linux-watchdog
Pull watchdog updates from Wim Van Sebroeck:
- Removal of the Documentation/watchdog/00-INDEX file
- Fix boot status reporting for imx2_wdt
- clean-up sp805_wdt, pnx4008_wdt and mpcore_wdt
- convert printk in watchdog drivers to pr_ functions
- change nowayout module parameter to bool for every watchdog device
- conversion of jz4740_wdt, pnx4008_wdt, max63xx_wdt, softdog,
ep93xx_wdt, coh901327 and txx9wdt to new watchdog API
- Add support for the WDIOC_GETTIMELEFT ioctl call to the new watchdog
API
- Change the new watchdog API so that the driver updates the timeout
value
- two fixes for the xen_wdt driver
Fix up conflicts in ep93xx driver due to the same patches being merged
through separate branches.
* git://www.linux-watchdog.org/linux-watchdog: (33 commits)
watchdog: txx9wdt: fix timeout
watchdog: Convert txx9wdt driver to watchdog framework
watchdog: coh901327_wdt.c: fix timeout
watchdog: coh901327: convert to use watchdog core
watchdog: Add support for WDIOC_GETTIMELEFT IOCTL in watchdog core
watchdog: ep93xx_wdt: timeout is an unsigned int value.
watchdog: ep93xx_wdt: Fix timeout after conversion to watchdog core
watchdog: Convert ep93xx driver to watchdog core
watchdog: sp805: Use devm routines
watchdog: sp805: replace readl/writel with lighter _relaxed variants
watchdog: sp805: Fix documentation style comment
watchdog: mpcore_wdt: Allow platform_get_irq() to fail
watchdog: mpcore_wdt: Use devm routines
watchdog: mpcore_wdt: Rename dev to pdev for pointing to struct platform_device
watchdog: xen: don't clear is_active when xen_wdt_stop() failed
watchdog: xen: don't unconditionally enable the watchdog during resume
watchdog: fix compiler error for missing parenthesis
watchdog: ep93xx_wdt.c: fix platform probe
watchdog: ep93xx: Convert the watchdog driver into a platform device.
watchdog: fix set_timeout operations
...
Diffstat (limited to 'drivers/watchdog/wdt.c')
-rw-r--r-- | drivers/watchdog/wdt.c | 55 |
1 files changed, 26 insertions, 29 deletions
diff --git a/drivers/watchdog/wdt.c b/drivers/watchdog/wdt.c index d2ef002be96b..64079d933c63 100644 --- a/drivers/watchdog/wdt.c +++ b/drivers/watchdog/wdt.c @@ -32,6 +32,8 @@ * Matt Domsch : Added nowayout module option */ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + #include <linux/interrupt.h> #include <linux/module.h> #include <linux/moduleparam.h> @@ -65,8 +67,8 @@ MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (0 < heartbeat < 65536, default=" __MODULE_STRING(WD_TIMO) ")"); -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) ")"); @@ -252,11 +254,11 @@ static int wdt_get_temperature(void) static void wdt_decode_501(int status) { if (!(status & WDC_SR_TGOOD)) - printk(KERN_CRIT "Overheat alarm.(%d)\n", inb_p(WDT_RT)); + pr_crit("Overheat alarm (%d)\n", inb_p(WDT_RT)); if (!(status & WDC_SR_PSUOVER)) - printk(KERN_CRIT "PSU over voltage.\n"); + pr_crit("PSU over voltage\n"); if (!(status & WDC_SR_PSUUNDR)) - printk(KERN_CRIT "PSU under voltage.\n"); + pr_crit("PSU under voltage\n"); } /** @@ -280,25 +282,25 @@ static irqreturn_t wdt_interrupt(int irq, void *dev_id) spin_lock(&wdt_lock); status = inb_p(WDT_SR); - printk(KERN_CRIT "WDT status %d\n", status); + pr_crit("WDT status %d\n", status); if (type == 501) { wdt_decode_501(status); if (tachometer) { if (!(status & WDC_SR_FANGOOD)) - printk(KERN_CRIT "Possible fan fault.\n"); + pr_crit("Possible fan fault\n"); } } if (!(status & WDC_SR_WCCR)) { #ifdef SOFTWARE_REBOOT #ifdef ONLY_TESTING - printk(KERN_CRIT "Would Reboot.\n"); + pr_crit("Would Reboot\n"); #else - printk(KERN_CRIT "Initiating system reboot.\n"); + pr_crit("Initiating system reboot\n"); emergency_restart(); #endif #else - printk(KERN_CRIT "Reset in 5ms.\n"); + pr_crit("Reset in 5ms\n"); #endif } spin_unlock(&wdt_lock); @@ -441,8 +443,7 @@ static int wdt_release(struct inode *inode, struct file *file) wdt_stop(); clear_bit(0, &wdt_is_open); } else { - printk(KERN_CRIT - "wdt: WDT device closed unexpectedly. WDT will not stop!\n"); + pr_crit("WDT device closed unexpectedly. WDT will not stop!\n"); wdt_ping(); } expect_close = 0; @@ -593,7 +594,7 @@ static int __init wdt_init(void) int ret; if (type != 500 && type != 501) { - printk(KERN_ERR "wdt: unknown card type '%d'.\n", type); + pr_err("unknown card type '%d'\n", type); return -ENODEV; } @@ -601,53 +602,49 @@ static int __init wdt_init(void) if not reset to the default */ if (wdt_set_heartbeat(heartbeat)) { wdt_set_heartbeat(WD_TIMO); - printk(KERN_INFO "wdt: heartbeat value must be " - "0 < heartbeat < 65536, using %d\n", WD_TIMO); + pr_info("heartbeat value must be 0 < heartbeat < 65536, using %d\n", + WD_TIMO); } if (!request_region(io, 8, "wdt501p")) { - printk(KERN_ERR - "wdt: I/O address 0x%04x already in use\n", io); + pr_err("I/O address 0x%04x already in use\n", io); ret = -EBUSY; goto out; } ret = request_irq(irq, wdt_interrupt, 0, "wdt501p", NULL); if (ret) { - printk(KERN_ERR "wdt: IRQ %d is not free.\n", irq); + pr_err("IRQ %d is not free\n", irq); goto outreg; } ret = register_reboot_notifier(&wdt_notifier); if (ret) { - printk(KERN_ERR - "wdt: cannot register reboot notifier (err=%d)\n", ret); + pr_err("cannot register reboot notifier (err=%d)\n", ret); goto outirq; } if (type == 501) { ret = misc_register(&temp_miscdev); if (ret) { - printk(KERN_ERR "wdt: cannot register miscdev " - "on minor=%d (err=%d)\n", TEMP_MINOR, ret); + pr_err("cannot register miscdev on minor=%d (err=%d)\n", + TEMP_MINOR, ret); goto outrbt; } } ret = misc_register(&wdt_miscdev); if (ret) { - printk(KERN_ERR - "wdt: 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 outmisc; } - printk(KERN_INFO "WDT500/501-P driver 0.10 " - "at 0x%04x (Interrupt %d). heartbeat=%d sec (nowayout=%d)\n", + pr_info("WDT500/501-P driver 0.10 at 0x%04x (Interrupt %d). heartbeat=%d sec (nowayout=%d)\n", io, irq, heartbeat, nowayout); if (type == 501) - printk(KERN_INFO "wdt: Fan Tachometer is %s\n", - (tachometer ? "Enabled" : "Disabled")); + pr_info("Fan Tachometer is %s\n", + tachometer ? "Enabled" : "Disabled"); return 0; outmisc: |