aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog/w83877f_wdt.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-03-28 16:03:26 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-03-28 16:03:26 -0400
commit750f77064a290beb162352077b52c61b04bcae0e (patch)
tree736a8dd043dc4cda298762a80e7c1fbf1bb87742 /drivers/watchdog/w83877f_wdt.c
parent89e5d6f0d979f6e7dc2bbb1ebd9e239217e2e952 (diff)
parentb92c803ec61de59e6e4ab9b2748d8e633cec3f08 (diff)
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/w83877f_wdt.c')
-rw-r--r--drivers/watchdog/w83877f_wdt.c40
1 files changed, 17 insertions, 23 deletions
diff --git a/drivers/watchdog/w83877f_wdt.c b/drivers/watchdog/w83877f_wdt.c
index 24587d2060c4..e76e7e309301 100644
--- a/drivers/watchdog/w83877f_wdt.c
+++ b/drivers/watchdog/w83877f_wdt.c
@@ -42,6 +42,8 @@
42 * daemon always getting scheduled within that time frame. 42 * daemon always getting scheduled within that time frame.
43 */ 43 */
44 44
45#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
46
45#include <linux/module.h> 47#include <linux/module.h>
46#include <linux/moduleparam.h> 48#include <linux/moduleparam.h>
47#include <linux/types.h> 49#include <linux/types.h>
@@ -59,7 +61,6 @@
59#include <asm/system.h> 61#include <asm/system.h>
60 62
61#define OUR_NAME "w83877f_wdt" 63#define OUR_NAME "w83877f_wdt"
62#define PFX OUR_NAME ": "
63 64
64#define ENABLE_W83877F_PORT 0x3F0 65#define ENABLE_W83877F_PORT 0x3F0
65#define ENABLE_W83877F 0x87 66#define ENABLE_W83877F 0x87
@@ -91,8 +92,8 @@ MODULE_PARM_DESC(timeout,
91 __MODULE_STRING(WATCHDOG_TIMEOUT) ")"); 92 __MODULE_STRING(WATCHDOG_TIMEOUT) ")");
92 93
93 94
94static int nowayout = WATCHDOG_NOWAYOUT; 95static bool nowayout = WATCHDOG_NOWAYOUT;
95module_param(nowayout, int, 0); 96module_param(nowayout, bool, 0);
96MODULE_PARM_DESC(nowayout, 97MODULE_PARM_DESC(nowayout,
97 "Watchdog cannot be stopped once started (default=" 98 "Watchdog cannot be stopped once started (default="
98 __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); 99 __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
@@ -126,8 +127,7 @@ static void wdt_timer_ping(unsigned long data)
126 spin_unlock(&wdt_spinlock); 127 spin_unlock(&wdt_spinlock);
127 128
128 } else 129 } else
129 printk(KERN_WARNING PFX 130 pr_warn("Heartbeat lost! Will not ping the watchdog\n");
130 "Heartbeat lost! Will not ping the watchdog\n");
131} 131}
132 132
133/* 133/*
@@ -165,7 +165,7 @@ static void wdt_startup(void)
165 165
166 wdt_change(WDT_ENABLE); 166 wdt_change(WDT_ENABLE);
167 167
168 printk(KERN_INFO PFX "Watchdog timer is now enabled.\n"); 168 pr_info("Watchdog timer is now enabled\n");
169} 169}
170 170
171static void wdt_turnoff(void) 171static void wdt_turnoff(void)
@@ -175,7 +175,7 @@ static void wdt_turnoff(void)
175 175
176 wdt_change(WDT_DISABLE); 176 wdt_change(WDT_DISABLE);
177 177
178 printk(KERN_INFO PFX "Watchdog timer is now disabled...\n"); 178 pr_info("Watchdog timer is now disabled...\n");
179} 179}
180 180
181static void wdt_keepalive(void) 181static void wdt_keepalive(void)
@@ -234,8 +234,7 @@ static int fop_close(struct inode *inode, struct file *file)
234 wdt_turnoff(); 234 wdt_turnoff();
235 else { 235 else {
236 del_timer(&timer); 236 del_timer(&timer);
237 printk(KERN_CRIT PFX 237 pr_crit("device file closed unexpectedly. Will not stop the WDT!\n");
238 "device file closed unexpectedly. Will not stop the WDT!\n");
239 } 238 }
240 clear_bit(0, &wdt_is_open); 239 clear_bit(0, &wdt_is_open);
241 wdt_expect_close = 0; 240 wdt_expect_close = 0;
@@ -357,42 +356,37 @@ static int __init w83877f_wdt_init(void)
357 356
358 if (timeout < 1 || timeout > 3600) { /* arbitrary upper limit */ 357 if (timeout < 1 || timeout > 3600) { /* arbitrary upper limit */
359 timeout = WATCHDOG_TIMEOUT; 358 timeout = WATCHDOG_TIMEOUT;
360 printk(KERN_INFO PFX 359 pr_info("timeout value must be 1 <= x <= 3600, using %d\n",
361 "timeout value must be 1 <= x <= 3600, using %d\n", 360 timeout);
362 timeout);
363 } 361 }
364 362
365 if (!request_region(ENABLE_W83877F_PORT, 2, "W83877F WDT")) { 363 if (!request_region(ENABLE_W83877F_PORT, 2, "W83877F WDT")) {
366 printk(KERN_ERR PFX "I/O address 0x%04x already in use\n", 364 pr_err("I/O address 0x%04x already in use\n",
367 ENABLE_W83877F_PORT); 365 ENABLE_W83877F_PORT);
368 rc = -EIO; 366 rc = -EIO;
369 goto err_out; 367 goto err_out;
370 } 368 }
371 369
372 if (!request_region(WDT_PING, 1, "W8387FF WDT")) { 370 if (!request_region(WDT_PING, 1, "W8387FF WDT")) {
373 printk(KERN_ERR PFX "I/O address 0x%04x already in use\n", 371 pr_err("I/O address 0x%04x already in use\n", WDT_PING);
374 WDT_PING);
375 rc = -EIO; 372 rc = -EIO;
376 goto err_out_region1; 373 goto err_out_region1;
377 } 374 }
378 375
379 rc = register_reboot_notifier(&wdt_notifier); 376 rc = register_reboot_notifier(&wdt_notifier);
380 if (rc) { 377 if (rc) {
381 printk(KERN_ERR PFX 378 pr_err("cannot register reboot notifier (err=%d)\n", rc);
382 "cannot register reboot notifier (err=%d)\n", rc);
383 goto err_out_region2; 379 goto err_out_region2;
384 } 380 }
385 381
386 rc = misc_register(&wdt_miscdev); 382 rc = misc_register(&wdt_miscdev);
387 if (rc) { 383 if (rc) {
388 printk(KERN_ERR PFX 384 pr_err("cannot register miscdev on minor=%d (err=%d)\n",
389 "cannot register miscdev on minor=%d (err=%d)\n", 385 wdt_miscdev.minor, rc);
390 wdt_miscdev.minor, rc);
391 goto err_out_reboot; 386 goto err_out_reboot;
392 } 387 }
393 388
394 printk(KERN_INFO PFX 389 pr_info("WDT driver for W83877F initialised. timeout=%d sec (nowayout=%d)\n",
395 "WDT driver for W83877F initialised. timeout=%d sec (nowayout=%d)\n",
396 timeout, nowayout); 390 timeout, nowayout);
397 391
398 return 0; 392 return 0;