diff options
Diffstat (limited to 'drivers/watchdog/w83627hf_wdt.c')
-rw-r--r-- | drivers/watchdog/w83627hf_wdt.c | 38 |
1 files changed, 16 insertions, 22 deletions
diff --git a/drivers/watchdog/w83627hf_wdt.c b/drivers/watchdog/w83627hf_wdt.c index 1283d0671c70..92f1326f0cfc 100644 --- a/drivers/watchdog/w83627hf_wdt.c +++ b/drivers/watchdog/w83627hf_wdt.c | |||
@@ -26,6 +26,8 @@ | |||
26 | * (c) Copyright 1995 Alan Cox <alan@lxorguk.ukuu.org.uk> | 26 | * (c) Copyright 1995 Alan Cox <alan@lxorguk.ukuu.org.uk> |
27 | */ | 27 | */ |
28 | 28 | ||
29 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
30 | |||
29 | #include <linux/module.h> | 31 | #include <linux/module.h> |
30 | #include <linux/moduleparam.h> | 32 | #include <linux/moduleparam.h> |
31 | #include <linux/types.h> | 33 | #include <linux/types.h> |
@@ -42,7 +44,6 @@ | |||
42 | 44 | ||
43 | 45 | ||
44 | #define WATCHDOG_NAME "w83627hf/thf/hg/dhg WDT" | 46 | #define WATCHDOG_NAME "w83627hf/thf/hg/dhg WDT" |
45 | #define PFX WATCHDOG_NAME ": " | ||
46 | #define WATCHDOG_TIMEOUT 60 /* 60 sec default timeout */ | 47 | #define WATCHDOG_TIMEOUT 60 /* 60 sec default timeout */ |
47 | 48 | ||
48 | static unsigned long wdt_is_open; | 49 | static unsigned long wdt_is_open; |
@@ -60,8 +61,8 @@ MODULE_PARM_DESC(timeout, | |||
60 | "Watchdog timeout in seconds. 1 <= timeout <= 255, default=" | 61 | "Watchdog timeout in seconds. 1 <= timeout <= 255, default=" |
61 | __MODULE_STRING(WATCHDOG_TIMEOUT) "."); | 62 | __MODULE_STRING(WATCHDOG_TIMEOUT) "."); |
62 | 63 | ||
63 | static int nowayout = WATCHDOG_NOWAYOUT; | 64 | static bool nowayout = WATCHDOG_NOWAYOUT; |
64 | module_param(nowayout, int, 0); | 65 | module_param(nowayout, bool, 0); |
65 | MODULE_PARM_DESC(nowayout, | 66 | MODULE_PARM_DESC(nowayout, |
66 | "Watchdog cannot be stopped once started (default=" | 67 | "Watchdog cannot be stopped once started (default=" |
67 | __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); | 68 | __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); |
@@ -118,9 +119,8 @@ static void w83627hf_init(void) | |||
118 | outb_p(0xF6, WDT_EFER); /* Select CRF6 */ | 119 | outb_p(0xF6, WDT_EFER); /* Select CRF6 */ |
119 | t = inb_p(WDT_EFDR); /* read CRF6 */ | 120 | t = inb_p(WDT_EFDR); /* read CRF6 */ |
120 | if (t != 0) { | 121 | if (t != 0) { |
121 | printk(KERN_INFO PFX | 122 | pr_info("Watchdog already running. Resetting timeout to %d sec\n", |
122 | "Watchdog already running. Resetting timeout to %d sec\n", | 123 | timeout); |
123 | timeout); | ||
124 | outb_p(timeout, WDT_EFDR); /* Write back to CRF6 */ | 124 | outb_p(timeout, WDT_EFDR); /* Write back to CRF6 */ |
125 | } | 125 | } |
126 | 126 | ||
@@ -289,8 +289,7 @@ static int wdt_close(struct inode *inode, struct file *file) | |||
289 | if (expect_close == 42) | 289 | if (expect_close == 42) |
290 | wdt_disable(); | 290 | wdt_disable(); |
291 | else { | 291 | else { |
292 | printk(KERN_CRIT PFX | 292 | pr_crit("Unexpected close, not stopping watchdog!\n"); |
293 | "Unexpected close, not stopping watchdog!\n"); | ||
294 | wdt_ping(); | 293 | wdt_ping(); |
295 | } | 294 | } |
296 | expect_close = 0; | 295 | expect_close = 0; |
@@ -343,18 +342,16 @@ static int __init wdt_init(void) | |||
343 | { | 342 | { |
344 | int ret; | 343 | int ret; |
345 | 344 | ||
346 | printk(KERN_INFO "WDT driver for the Winbond(TM) W83627HF/THF/HG/DHG Super I/O chip initialising.\n"); | 345 | pr_info("WDT driver for the Winbond(TM) W83627HF/THF/HG/DHG Super I/O chip initialising\n"); |
347 | 346 | ||
348 | if (wdt_set_heartbeat(timeout)) { | 347 | if (wdt_set_heartbeat(timeout)) { |
349 | wdt_set_heartbeat(WATCHDOG_TIMEOUT); | 348 | wdt_set_heartbeat(WATCHDOG_TIMEOUT); |
350 | printk(KERN_INFO PFX | 349 | pr_info("timeout value must be 1 <= timeout <= 255, using %d\n", |
351 | "timeout value must be 1 <= timeout <= 255, using %d\n", | 350 | WATCHDOG_TIMEOUT); |
352 | WATCHDOG_TIMEOUT); | ||
353 | } | 351 | } |
354 | 352 | ||
355 | if (!request_region(wdt_io, 1, WATCHDOG_NAME)) { | 353 | if (!request_region(wdt_io, 1, WATCHDOG_NAME)) { |
356 | printk(KERN_ERR PFX "I/O address 0x%04x already in use\n", | 354 | pr_err("I/O address 0x%04x already in use\n", wdt_io); |
357 | wdt_io); | ||
358 | ret = -EIO; | 355 | ret = -EIO; |
359 | goto out; | 356 | goto out; |
360 | } | 357 | } |
@@ -363,22 +360,19 @@ static int __init wdt_init(void) | |||
363 | 360 | ||
364 | ret = register_reboot_notifier(&wdt_notifier); | 361 | ret = register_reboot_notifier(&wdt_notifier); |
365 | if (ret != 0) { | 362 | if (ret != 0) { |
366 | printk(KERN_ERR PFX | 363 | pr_err("cannot register reboot notifier (err=%d)\n", ret); |
367 | "cannot register reboot notifier (err=%d)\n", ret); | ||
368 | goto unreg_regions; | 364 | goto unreg_regions; |
369 | } | 365 | } |
370 | 366 | ||
371 | ret = misc_register(&wdt_miscdev); | 367 | ret = misc_register(&wdt_miscdev); |
372 | if (ret != 0) { | 368 | if (ret != 0) { |
373 | printk(KERN_ERR PFX | 369 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
374 | "cannot register miscdev on minor=%d (err=%d)\n", | 370 | WATCHDOG_MINOR, ret); |
375 | WATCHDOG_MINOR, ret); | ||
376 | goto unreg_reboot; | 371 | goto unreg_reboot; |
377 | } | 372 | } |
378 | 373 | ||
379 | printk(KERN_INFO PFX | 374 | pr_info("initialized. timeout=%d sec (nowayout=%d)\n", |
380 | "initialized. timeout=%d sec (nowayout=%d)\n", | 375 | timeout, nowayout); |
381 | timeout, nowayout); | ||
382 | 376 | ||
383 | out: | 377 | out: |
384 | return ret; | 378 | return ret; |