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/w83977f_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/w83977f_wdt.c')
-rw-r--r-- | drivers/watchdog/w83977f_wdt.c | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/drivers/watchdog/w83977f_wdt.c b/drivers/watchdog/w83977f_wdt.c index 6e6743d1066f..d301b1bf1664 100644 --- a/drivers/watchdog/w83977f_wdt.c +++ b/drivers/watchdog/w83977f_wdt.c | |||
@@ -15,6 +15,8 @@ | |||
15 | * | 15 | * |
16 | */ | 16 | */ |
17 | 17 | ||
18 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
19 | |||
18 | #include <linux/module.h> | 20 | #include <linux/module.h> |
19 | #include <linux/moduleparam.h> | 21 | #include <linux/moduleparam.h> |
20 | #include <linux/types.h> | 22 | #include <linux/types.h> |
@@ -33,8 +35,6 @@ | |||
33 | 35 | ||
34 | #define WATCHDOG_VERSION "1.00" | 36 | #define WATCHDOG_VERSION "1.00" |
35 | #define WATCHDOG_NAME "W83977F WDT" | 37 | #define WATCHDOG_NAME "W83977F WDT" |
36 | #define PFX WATCHDOG_NAME ": " | ||
37 | #define DRIVER_VERSION WATCHDOG_NAME " driver, v" WATCHDOG_VERSION "\n" | ||
38 | 38 | ||
39 | #define IO_INDEX_PORT 0x3F0 | 39 | #define IO_INDEX_PORT 0x3F0 |
40 | #define IO_DATA_PORT (IO_INDEX_PORT+1) | 40 | #define IO_DATA_PORT (IO_INDEX_PORT+1) |
@@ -131,7 +131,7 @@ static int wdt_start(void) | |||
131 | 131 | ||
132 | spin_unlock_irqrestore(&spinlock, flags); | 132 | spin_unlock_irqrestore(&spinlock, flags); |
133 | 133 | ||
134 | printk(KERN_INFO PFX "activated.\n"); | 134 | pr_info("activated\n"); |
135 | 135 | ||
136 | return 0; | 136 | return 0; |
137 | } | 137 | } |
@@ -185,7 +185,7 @@ static int wdt_stop(void) | |||
185 | 185 | ||
186 | spin_unlock_irqrestore(&spinlock, flags); | 186 | spin_unlock_irqrestore(&spinlock, flags); |
187 | 187 | ||
188 | printk(KERN_INFO PFX "shutdown.\n"); | 188 | pr_info("shutdown\n"); |
189 | 189 | ||
190 | return 0; | 190 | return 0; |
191 | } | 191 | } |
@@ -313,8 +313,7 @@ static int wdt_release(struct inode *inode, struct file *file) | |||
313 | clear_bit(0, &timer_alive); | 313 | clear_bit(0, &timer_alive); |
314 | } else { | 314 | } else { |
315 | wdt_keepalive(); | 315 | wdt_keepalive(); |
316 | printk(KERN_CRIT PFX | 316 | pr_crit("unexpected close, not stopping watchdog!\n"); |
317 | "unexpected close, not stopping watchdog!\n"); | ||
318 | } | 317 | } |
319 | expect_close = 0; | 318 | expect_close = 0; |
320 | return 0; | 319 | return 0; |
@@ -471,7 +470,7 @@ static int __init w83977f_wdt_init(void) | |||
471 | { | 470 | { |
472 | int rc; | 471 | int rc; |
473 | 472 | ||
474 | printk(KERN_INFO PFX DRIVER_VERSION); | 473 | pr_info("driver v%s\n", WATCHDOG_VERSION); |
475 | 474 | ||
476 | /* | 475 | /* |
477 | * Check that the timeout value is within it's range; | 476 | * Check that the timeout value is within it's range; |
@@ -479,36 +478,31 @@ static int __init w83977f_wdt_init(void) | |||
479 | */ | 478 | */ |
480 | if (wdt_set_timeout(timeout)) { | 479 | if (wdt_set_timeout(timeout)) { |
481 | wdt_set_timeout(DEFAULT_TIMEOUT); | 480 | wdt_set_timeout(DEFAULT_TIMEOUT); |
482 | printk(KERN_INFO PFX | 481 | pr_info("timeout value must be 15 <= timeout <= 7635, using %d\n", |
483 | "timeout value must be 15 <= timeout <= 7635, using %d\n", | 482 | DEFAULT_TIMEOUT); |
484 | DEFAULT_TIMEOUT); | ||
485 | } | 483 | } |
486 | 484 | ||
487 | if (!request_region(IO_INDEX_PORT, 2, WATCHDOG_NAME)) { | 485 | if (!request_region(IO_INDEX_PORT, 2, WATCHDOG_NAME)) { |
488 | printk(KERN_ERR PFX "I/O address 0x%04x already in use\n", | 486 | pr_err("I/O address 0x%04x already in use\n", IO_INDEX_PORT); |
489 | IO_INDEX_PORT); | ||
490 | rc = -EIO; | 487 | rc = -EIO; |
491 | goto err_out; | 488 | goto err_out; |
492 | } | 489 | } |
493 | 490 | ||
494 | rc = register_reboot_notifier(&wdt_notifier); | 491 | rc = register_reboot_notifier(&wdt_notifier); |
495 | if (rc) { | 492 | if (rc) { |
496 | printk(KERN_ERR PFX | 493 | pr_err("cannot register reboot notifier (err=%d)\n", rc); |
497 | "cannot register reboot notifier (err=%d)\n", rc); | ||
498 | goto err_out_region; | 494 | goto err_out_region; |
499 | } | 495 | } |
500 | 496 | ||
501 | rc = misc_register(&wdt_miscdev); | 497 | rc = misc_register(&wdt_miscdev); |
502 | if (rc) { | 498 | if (rc) { |
503 | printk(KERN_ERR PFX | 499 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
504 | "cannot register miscdev on minor=%d (err=%d)\n", | 500 | wdt_miscdev.minor, rc); |
505 | wdt_miscdev.minor, rc); | ||
506 | goto err_out_reboot; | 501 | goto err_out_reboot; |
507 | } | 502 | } |
508 | 503 | ||
509 | printk(KERN_INFO PFX | 504 | pr_info("initialized. timeout=%d sec (nowayout=%d testmode=%d)\n", |
510 | "initialized. timeout=%d sec (nowayout=%d testmode=%d)\n", | 505 | timeout, nowayout, testmode); |
511 | timeout, nowayout, testmode); | ||
512 | 506 | ||
513 | return 0; | 507 | return 0; |
514 | 508 | ||