diff options
author | Joe Perches <joe@perches.com> | 2012-02-15 15:06:19 -0800 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2012-03-27 19:59:26 +0200 |
commit | 27c766aaacb265d625dc634bf7903f7f9fd0c697 (patch) | |
tree | 06b399d21dec006bc0a3e1c6685b076753e19b94 /drivers/watchdog/bfin_wdt.c | |
parent | 7cbc353540c31ffaf65ad44d89b955be0f1d04dc (diff) | |
download | lwn-27c766aaacb265d625dc634bf7903f7f9fd0c697.tar.gz lwn-27c766aaacb265d625dc634bf7903f7f9fd0c697.zip |
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 @@ * Licensed under the GPL-2 or later. */ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + #include <linux/platform_device.h> #include <linux/module.h> #include <linux/moduleparam.h> @@ -28,15 +30,8 @@ #define stamp(fmt, args...) \ pr_debug("%s:%i: " fmt "\n", __func__, __LINE__, ## args) #define stampit() stamp("here i am") -#define pr_devinit(fmt, args...) \ - ({ static const __devinitconst char __fmt[] = fmt; \ - printk(__fmt, ## args); }) -#define pr_init(fmt, args...) \ - ({ static const __initconst char __fmt[] = fmt; \ - printk(__fmt, ## args); }) #define WATCHDOG_NAME "bfin-wdt" -#define PFX WATCHDOG_NAME ": " /* The BF561 has two watchdogs (one per core), but since Linux * 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) stamp("maxtimeout=%us newtimeout=%lus (cnt=%#x)", max_t, t, cnt); if (t > max_t) { - printk(KERN_WARNING PFX "timeout value is too large\n"); + pr_warn("timeout value is too large\n"); return -EINVAL; } @@ -182,8 +177,7 @@ static int bfin_wdt_release(struct inode *inode, struct file *file) if (expect_close == 42) bfin_wdt_stop(); else { - printk(KERN_CRIT PFX - "Unexpected close, not stopping watchdog!\n"); + pr_crit("Unexpected close, not stopping watchdog!\n"); bfin_wdt_keepalive(); } expect_close = 0; @@ -368,14 +362,13 @@ static int __devinit bfin_wdt_probe(struct platform_device *pdev) ret = misc_register(&bfin_wdt_miscdev); if (ret) { - pr_devinit(KERN_ERR PFX - "cannot register miscdev on minor=%d (err=%d)\n", - WATCHDOG_MINOR, ret); + pr_err("cannot register miscdev on minor=%d (err=%d)\n", + WATCHDOG_MINOR, ret); return ret; } - pr_devinit(KERN_INFO PFX "initialized: timeout=%d sec (nowayout=%d)\n", - timeout, nowayout); + pr_info("initialized: timeout=%d sec (nowayout=%d)\n", + timeout, nowayout); return 0; } @@ -439,14 +432,14 @@ static int __init bfin_wdt_init(void) */ ret = platform_driver_register(&bfin_wdt_driver); if (ret) { - pr_init(KERN_ERR PFX "unable to register driver\n"); + pr_err("unable to register driver\n"); return ret; } bfin_wdt_device = platform_device_register_simple(WATCHDOG_NAME, -1, NULL, 0); if (IS_ERR(bfin_wdt_device)) { - pr_init(KERN_ERR PFX "unable to register device\n"); + pr_err("unable to register device\n"); platform_driver_unregister(&bfin_wdt_driver); return PTR_ERR(bfin_wdt_device); } |