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/w83697hf_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/w83697hf_wdt.c')
-rw-r--r-- | drivers/watchdog/w83697hf_wdt.c | 39 |
1 files changed, 16 insertions, 23 deletions
diff --git a/drivers/watchdog/w83697hf_wdt.c b/drivers/watchdog/w83697hf_wdt.c index af08972de50..23074184c21 100644 --- a/drivers/watchdog/w83697hf_wdt.c +++ b/drivers/watchdog/w83697hf_wdt.c @@ -25,6 +25,8 @@ * "AS-IS" and at no charge. */ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/types.h> @@ -42,7 +44,6 @@ #include <asm/system.h> #define WATCHDOG_NAME "w83697hf/hg WDT" -#define PFX WATCHDOG_NAME ": " #define WATCHDOG_TIMEOUT 60 /* 60 sec default timeout */ #define WATCHDOG_EARLY_DISABLE 1 /* Disable until userland kicks in */ @@ -309,8 +310,7 @@ static int wdt_close(struct inode *inode, struct file *file) if (expect_close == 42) wdt_disable(); else { - printk(KERN_CRIT PFX - "Unexpected close, not stopping watchdog!\n"); + pr_crit("Unexpected close, not stopping watchdog!\n"); wdt_ping(); } expect_close = 0; @@ -362,24 +362,21 @@ static struct notifier_block wdt_notifier = { static int w83697hf_check_wdt(void) { if (!request_region(wdt_io, 2, WATCHDOG_NAME)) { - printk(KERN_ERR PFX - "I/O address 0x%x already in use\n", wdt_io); + pr_err("I/O address 0x%x already in use\n", wdt_io); return -EIO; } - printk(KERN_DEBUG PFX - "Looking for watchdog at address 0x%x\n", wdt_io); + pr_debug("Looking for watchdog at address 0x%x\n", wdt_io); w83697hf_unlock(); if (w83697hf_get_reg(0x20) == 0x60) { - printk(KERN_INFO PFX - "watchdog found at address 0x%x\n", wdt_io); + pr_info("watchdog found at address 0x%x\n", wdt_io); w83697hf_lock(); return 0; } /* Reprotect in case it was a compatible device */ w83697hf_lock(); - printk(KERN_INFO PFX "watchdog not found at address 0x%x\n", wdt_io); + pr_info("watchdog not found at address 0x%x\n", wdt_io); release_region(wdt_io, 2); return -EIO; } @@ -390,7 +387,7 @@ static int __init wdt_init(void) { int ret, i, found = 0; - printk(KERN_INFO PFX "WDT driver for W83697HF/HG initializing\n"); + pr_info("WDT driver for W83697HF/HG initializing\n"); if (wdt_io == 0) { /* we will autodetect the W83697HF/HG watchdog */ @@ -405,7 +402,7 @@ static int __init wdt_init(void) } if (!found) { - printk(KERN_ERR PFX "No W83697HF/HG could be found\n"); + pr_err("No W83697HF/HG could be found\n"); ret = -EIO; goto out; } @@ -413,34 +410,30 @@ static int __init wdt_init(void) w83697hf_init(); if (early_disable) { if (wdt_running()) - printk(KERN_WARNING PFX "Stopping previously enabled " - "watchdog until userland kicks in\n"); + pr_warn("Stopping previously enabled watchdog until userland kicks in\n"); wdt_disable(); } if (wdt_set_heartbeat(timeout)) { wdt_set_heartbeat(WATCHDOG_TIMEOUT); - printk(KERN_INFO PFX - "timeout value must be 1 <= timeout <= 255, using %d\n", - WATCHDOG_TIMEOUT); + pr_info("timeout value must be 1 <= timeout <= 255, using %d\n", + WATCHDOG_TIMEOUT); } ret = register_reboot_notifier(&wdt_notifier); if (ret != 0) { - printk(KERN_ERR PFX - "cannot register reboot notifier (err=%d)\n", ret); + pr_err("cannot register reboot notifier (err=%d)\n", ret); goto unreg_regions; } ret = misc_register(&wdt_miscdev); if (ret != 0) { - printk(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); goto unreg_reboot; } - printk(KERN_INFO PFX "initialized. timeout=%d sec (nowayout=%d)\n", + pr_info("initialized. timeout=%d sec (nowayout=%d)\n", timeout, nowayout); out: |