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/bfin_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/bfin_wdt.c')
-rw-r--r-- | drivers/watchdog/bfin_wdt.c | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/drivers/watchdog/bfin_wdt.c b/drivers/watchdog/bfin_wdt.c index b9fa9b71583a..402e9ccea395 100644 --- a/drivers/watchdog/bfin_wdt.c +++ b/drivers/watchdog/bfin_wdt.c | |||
@@ -11,6 +11,8 @@ | |||
11 | * Licensed under the GPL-2 or later. | 11 | * Licensed under the GPL-2 or later. |
12 | */ | 12 | */ |
13 | 13 | ||
14 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
15 | |||
14 | #include <linux/platform_device.h> | 16 | #include <linux/platform_device.h> |
15 | #include <linux/module.h> | 17 | #include <linux/module.h> |
16 | #include <linux/moduleparam.h> | 18 | #include <linux/moduleparam.h> |
@@ -28,15 +30,8 @@ | |||
28 | #define stamp(fmt, args...) \ | 30 | #define stamp(fmt, args...) \ |
29 | pr_debug("%s:%i: " fmt "\n", __func__, __LINE__, ## args) | 31 | pr_debug("%s:%i: " fmt "\n", __func__, __LINE__, ## args) |
30 | #define stampit() stamp("here i am") | 32 | #define stampit() stamp("here i am") |
31 | #define pr_devinit(fmt, args...) \ | ||
32 | ({ static const __devinitconst char __fmt[] = fmt; \ | ||
33 | printk(__fmt, ## args); }) | ||
34 | #define pr_init(fmt, args...) \ | ||
35 | ({ static const __initconst char __fmt[] = fmt; \ | ||
36 | printk(__fmt, ## args); }) | ||
37 | 33 | ||
38 | #define WATCHDOG_NAME "bfin-wdt" | 34 | #define WATCHDOG_NAME "bfin-wdt" |
39 | #define PFX WATCHDOG_NAME ": " | ||
40 | 35 | ||
41 | /* The BF561 has two watchdogs (one per core), but since Linux | 36 | /* The BF561 has two watchdogs (one per core), but since Linux |
42 | * only runs on core A, we'll just work with that one. | 37 | * only runs on core A, we'll just work with that one. |
@@ -126,7 +121,7 @@ static int bfin_wdt_set_timeout(unsigned long t) | |||
126 | stamp("maxtimeout=%us newtimeout=%lus (cnt=%#x)", max_t, t, cnt); | 121 | stamp("maxtimeout=%us newtimeout=%lus (cnt=%#x)", max_t, t, cnt); |
127 | 122 | ||
128 | if (t > max_t) { | 123 | if (t > max_t) { |
129 | printk(KERN_WARNING PFX "timeout value is too large\n"); | 124 | pr_warn("timeout value is too large\n"); |
130 | return -EINVAL; | 125 | return -EINVAL; |
131 | } | 126 | } |
132 | 127 | ||
@@ -182,8 +177,7 @@ static int bfin_wdt_release(struct inode *inode, struct file *file) | |||
182 | if (expect_close == 42) | 177 | if (expect_close == 42) |
183 | bfin_wdt_stop(); | 178 | bfin_wdt_stop(); |
184 | else { | 179 | else { |
185 | printk(KERN_CRIT PFX | 180 | pr_crit("Unexpected close, not stopping watchdog!\n"); |
186 | "Unexpected close, not stopping watchdog!\n"); | ||
187 | bfin_wdt_keepalive(); | 181 | bfin_wdt_keepalive(); |
188 | } | 182 | } |
189 | expect_close = 0; | 183 | expect_close = 0; |
@@ -368,14 +362,13 @@ static int __devinit bfin_wdt_probe(struct platform_device *pdev) | |||
368 | 362 | ||
369 | ret = misc_register(&bfin_wdt_miscdev); | 363 | ret = misc_register(&bfin_wdt_miscdev); |
370 | if (ret) { | 364 | if (ret) { |
371 | pr_devinit(KERN_ERR PFX | 365 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
372 | "cannot register miscdev on minor=%d (err=%d)\n", | 366 | WATCHDOG_MINOR, ret); |
373 | WATCHDOG_MINOR, ret); | ||
374 | return ret; | 367 | return ret; |
375 | } | 368 | } |
376 | 369 | ||
377 | pr_devinit(KERN_INFO PFX "initialized: timeout=%d sec (nowayout=%d)\n", | 370 | pr_info("initialized: timeout=%d sec (nowayout=%d)\n", |
378 | timeout, nowayout); | 371 | timeout, nowayout); |
379 | 372 | ||
380 | return 0; | 373 | return 0; |
381 | } | 374 | } |
@@ -439,14 +432,14 @@ static int __init bfin_wdt_init(void) | |||
439 | */ | 432 | */ |
440 | ret = platform_driver_register(&bfin_wdt_driver); | 433 | ret = platform_driver_register(&bfin_wdt_driver); |
441 | if (ret) { | 434 | if (ret) { |
442 | pr_init(KERN_ERR PFX "unable to register driver\n"); | 435 | pr_err("unable to register driver\n"); |
443 | return ret; | 436 | return ret; |
444 | } | 437 | } |
445 | 438 | ||
446 | bfin_wdt_device = platform_device_register_simple(WATCHDOG_NAME, | 439 | bfin_wdt_device = platform_device_register_simple(WATCHDOG_NAME, |
447 | -1, NULL, 0); | 440 | -1, NULL, 0); |
448 | if (IS_ERR(bfin_wdt_device)) { | 441 | if (IS_ERR(bfin_wdt_device)) { |
449 | pr_init(KERN_ERR PFX "unable to register device\n"); | 442 | pr_err("unable to register device\n"); |
450 | platform_driver_unregister(&bfin_wdt_driver); | 443 | platform_driver_unregister(&bfin_wdt_driver); |
451 | return PTR_ERR(bfin_wdt_device); | 444 | return PTR_ERR(bfin_wdt_device); |
452 | } | 445 | } |