aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog/mixcomwd.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/mixcomwd.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/mixcomwd.c')
-rw-r--r--drivers/watchdog/mixcomwd.c29
1 files changed, 12 insertions, 17 deletions
diff --git a/drivers/watchdog/mixcomwd.c b/drivers/watchdog/mixcomwd.c
index bc820d16699a..37e4b52dbce9 100644
--- a/drivers/watchdog/mixcomwd.c
+++ b/drivers/watchdog/mixcomwd.c
@@ -39,9 +39,10 @@
39 * 39 *
40 */ 40 */
41 41
42#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
43
42#define VERSION "0.6" 44#define VERSION "0.6"
43#define WATCHDOG_NAME "mixcomwd" 45#define WATCHDOG_NAME "mixcomwd"
44#define PFX WATCHDOG_NAME ": "
45 46
46#include <linux/module.h> 47#include <linux/module.h>
47#include <linux/moduleparam.h> 48#include <linux/moduleparam.h>
@@ -107,8 +108,8 @@ static int mixcomwd_timer_alive;
107static DEFINE_TIMER(mixcomwd_timer, mixcomwd_timerfun, 0, 0); 108static DEFINE_TIMER(mixcomwd_timer, mixcomwd_timerfun, 0, 0);
108static char expect_close; 109static char expect_close;
109 110
110static int nowayout = WATCHDOG_NOWAYOUT; 111static bool nowayout = WATCHDOG_NOWAYOUT;
111module_param(nowayout, int, 0); 112module_param(nowayout, bool, 0);
112MODULE_PARM_DESC(nowayout, 113MODULE_PARM_DESC(nowayout,
113 "Watchdog cannot be stopped once started (default=" 114 "Watchdog cannot be stopped once started (default="
114 __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); 115 __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
@@ -156,15 +157,13 @@ static int mixcomwd_release(struct inode *inode, struct file *file)
156{ 157{
157 if (expect_close == 42) { 158 if (expect_close == 42) {
158 if (mixcomwd_timer_alive) { 159 if (mixcomwd_timer_alive) {
159 printk(KERN_ERR PFX 160 pr_err("release called while internal timer alive\n");
160 "release called while internal timer alive");
161 return -EBUSY; 161 return -EBUSY;
162 } 162 }
163 mixcomwd_timer_alive = 1; 163 mixcomwd_timer_alive = 1;
164 mod_timer(&mixcomwd_timer, jiffies + 5 * HZ); 164 mod_timer(&mixcomwd_timer, jiffies + 5 * HZ);
165 } else 165 } else
166 printk(KERN_CRIT PFX 166 pr_crit("WDT device closed unexpectedly. WDT will not stop!\n");
167 "WDT device closed unexpectedly. WDT will not stop!\n");
168 167
169 clear_bit(0, &mixcomwd_opened); 168 clear_bit(0, &mixcomwd_opened);
170 expect_close = 0; 169 expect_close = 0;
@@ -274,22 +273,19 @@ static int __init mixcomwd_init(void)
274 } 273 }
275 274
276 if (!found) { 275 if (!found) {
277 printk(KERN_ERR PFX 276 pr_err("No card detected, or port not available\n");
278 "No card detected, or port not available.\n");
279 return -ENODEV; 277 return -ENODEV;
280 } 278 }
281 279
282 ret = misc_register(&mixcomwd_miscdev); 280 ret = misc_register(&mixcomwd_miscdev);
283 if (ret) { 281 if (ret) {
284 printk(KERN_ERR PFX 282 pr_err("cannot register miscdev on minor=%d (err=%d)\n",
285 "cannot register miscdev on minor=%d (err=%d)\n", 283 WATCHDOG_MINOR, ret);
286 WATCHDOG_MINOR, ret);
287 goto error_misc_register_watchdog; 284 goto error_misc_register_watchdog;
288 } 285 }
289 286
290 printk(KERN_INFO 287 pr_info("MixCOM watchdog driver v%s, watchdog port at 0x%3x\n",
291 "MixCOM watchdog driver v%s, watchdog port at 0x%3x\n", 288 VERSION, watchdog_port);
292 VERSION, watchdog_port);
293 289
294 return 0; 290 return 0;
295 291
@@ -303,8 +299,7 @@ static void __exit mixcomwd_exit(void)
303{ 299{
304 if (!nowayout) { 300 if (!nowayout) {
305 if (mixcomwd_timer_alive) { 301 if (mixcomwd_timer_alive) {
306 printk(KERN_WARNING PFX "I quit now, hardware will" 302 pr_warn("I quit now, hardware will probably reboot!\n");
307 " probably reboot!\n");
308 del_timer_sync(&mixcomwd_timer); 303 del_timer_sync(&mixcomwd_timer);
309 mixcomwd_timer_alive = 0; 304 mixcomwd_timer_alive = 0;
310 } 305 }