diff options
author | Joe Perches <joe@perches.com> | 2012-02-15 18:06:19 -0500 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2012-03-27 13:59:26 -0400 |
commit | 27c766aaacb265d625dc634bf7903f7f9fd0c697 (patch) | |
tree | 06b399d21dec006bc0a3e1c6685b076753e19b94 /drivers/watchdog/w83627hf_wdt.c | |
parent | 7cbc353540c31ffaf65ad44d89b955be0f1d04dc (diff) |
watchdog: Use pr_<fmt> and pr_<level>
Use the current logging styles.
Make sure all output has a prefix.
Add missing newlines.
Remove now unnecessary PFX, NAME, and miscellaneous other #defines.
Coalesce formats.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/watchdog/w83627hf_wdt.c')
-rw-r--r-- | drivers/watchdog/w83627hf_wdt.c | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/drivers/watchdog/w83627hf_wdt.c b/drivers/watchdog/w83627hf_wdt.c index 576a388a1164..969358732841 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> |
@@ -43,7 +45,6 @@ | |||
43 | #include <asm/system.h> | 45 | #include <asm/system.h> |
44 | 46 | ||
45 | #define WATCHDOG_NAME "w83627hf/thf/hg/dhg WDT" | 47 | #define WATCHDOG_NAME "w83627hf/thf/hg/dhg WDT" |
46 | #define PFX WATCHDOG_NAME ": " | ||
47 | #define WATCHDOG_TIMEOUT 60 /* 60 sec default timeout */ | 48 | #define WATCHDOG_TIMEOUT 60 /* 60 sec default timeout */ |
48 | 49 | ||
49 | static unsigned long wdt_is_open; | 50 | static unsigned long wdt_is_open; |
@@ -119,9 +120,8 @@ static void w83627hf_init(void) | |||
119 | outb_p(0xF6, WDT_EFER); /* Select CRF6 */ | 120 | outb_p(0xF6, WDT_EFER); /* Select CRF6 */ |
120 | t = inb_p(WDT_EFDR); /* read CRF6 */ | 121 | t = inb_p(WDT_EFDR); /* read CRF6 */ |
121 | if (t != 0) { | 122 | if (t != 0) { |
122 | printk(KERN_INFO PFX | 123 | pr_info("Watchdog already running. Resetting timeout to %d sec\n", |
123 | "Watchdog already running. Resetting timeout to %d sec\n", | 124 | timeout); |
124 | timeout); | ||
125 | outb_p(timeout, WDT_EFDR); /* Write back to CRF6 */ | 125 | outb_p(timeout, WDT_EFDR); /* Write back to CRF6 */ |
126 | } | 126 | } |
127 | 127 | ||
@@ -290,8 +290,7 @@ static int wdt_close(struct inode *inode, struct file *file) | |||
290 | if (expect_close == 42) | 290 | if (expect_close == 42) |
291 | wdt_disable(); | 291 | wdt_disable(); |
292 | else { | 292 | else { |
293 | printk(KERN_CRIT PFX | 293 | pr_crit("Unexpected close, not stopping watchdog!\n"); |
294 | "Unexpected close, not stopping watchdog!\n"); | ||
295 | wdt_ping(); | 294 | wdt_ping(); |
296 | } | 295 | } |
297 | expect_close = 0; | 296 | expect_close = 0; |
@@ -344,18 +343,16 @@ static int __init wdt_init(void) | |||
344 | { | 343 | { |
345 | int ret; | 344 | int ret; |
346 | 345 | ||
347 | printk(KERN_INFO "WDT driver for the Winbond(TM) W83627HF/THF/HG/DHG Super I/O chip initialising.\n"); | 346 | pr_info("WDT driver for the Winbond(TM) W83627HF/THF/HG/DHG Super I/O chip initialising\n"); |
348 | 347 | ||
349 | if (wdt_set_heartbeat(timeout)) { | 348 | if (wdt_set_heartbeat(timeout)) { |
350 | wdt_set_heartbeat(WATCHDOG_TIMEOUT); | 349 | wdt_set_heartbeat(WATCHDOG_TIMEOUT); |
351 | printk(KERN_INFO PFX | 350 | pr_info("timeout value must be 1 <= timeout <= 255, using %d\n", |
352 | "timeout value must be 1 <= timeout <= 255, using %d\n", | 351 | WATCHDOG_TIMEOUT); |
353 | WATCHDOG_TIMEOUT); | ||
354 | } | 352 | } |
355 | 353 | ||
356 | if (!request_region(wdt_io, 1, WATCHDOG_NAME)) { | 354 | if (!request_region(wdt_io, 1, WATCHDOG_NAME)) { |
357 | printk(KERN_ERR PFX "I/O address 0x%04x already in use\n", | 355 | pr_err("I/O address 0x%04x already in use\n", wdt_io); |
358 | wdt_io); | ||
359 | ret = -EIO; | 356 | ret = -EIO; |
360 | goto out; | 357 | goto out; |
361 | } | 358 | } |
@@ -364,22 +361,19 @@ static int __init wdt_init(void) | |||
364 | 361 | ||
365 | ret = register_reboot_notifier(&wdt_notifier); | 362 | ret = register_reboot_notifier(&wdt_notifier); |
366 | if (ret != 0) { | 363 | if (ret != 0) { |
367 | printk(KERN_ERR PFX | 364 | pr_err("cannot register reboot notifier (err=%d)\n", ret); |
368 | "cannot register reboot notifier (err=%d)\n", ret); | ||
369 | goto unreg_regions; | 365 | goto unreg_regions; |
370 | } | 366 | } |
371 | 367 | ||
372 | ret = misc_register(&wdt_miscdev); | 368 | ret = misc_register(&wdt_miscdev); |
373 | if (ret != 0) { | 369 | if (ret != 0) { |
374 | printk(KERN_ERR PFX | 370 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
375 | "cannot register miscdev on minor=%d (err=%d)\n", | 371 | WATCHDOG_MINOR, ret); |
376 | WATCHDOG_MINOR, ret); | ||
377 | goto unreg_reboot; | 372 | goto unreg_reboot; |
378 | } | 373 | } |
379 | 374 | ||
380 | printk(KERN_INFO PFX | 375 | pr_info("initialized. timeout=%d sec (nowayout=%d)\n", |
381 | "initialized. timeout=%d sec (nowayout=%d)\n", | 376 | timeout, nowayout); |
382 | timeout, nowayout); | ||
383 | 377 | ||
384 | out: | 378 | out: |
385 | return ret; | 379 | return ret; |