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/w83877f_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/w83877f_wdt.c')
-rw-r--r-- | drivers/watchdog/w83877f_wdt.c | 36 |
1 files changed, 15 insertions, 21 deletions
diff --git a/drivers/watchdog/w83877f_wdt.c b/drivers/watchdog/w83877f_wdt.c index 24587d2060c..d761414de80 100644 --- a/drivers/watchdog/w83877f_wdt.c +++ b/drivers/watchdog/w83877f_wdt.c @@ -42,6 +42,8 @@ * daemon always getting scheduled within that time frame. */ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/types.h> @@ -59,7 +61,6 @@ #include <asm/system.h> #define OUR_NAME "w83877f_wdt" -#define PFX OUR_NAME ": " #define ENABLE_W83877F_PORT 0x3F0 #define ENABLE_W83877F 0x87 @@ -126,8 +127,7 @@ static void wdt_timer_ping(unsigned long data) spin_unlock(&wdt_spinlock); } else - printk(KERN_WARNING PFX - "Heartbeat lost! Will not ping the watchdog\n"); + pr_warn("Heartbeat lost! Will not ping the watchdog\n"); } /* @@ -165,7 +165,7 @@ static void wdt_startup(void) wdt_change(WDT_ENABLE); - printk(KERN_INFO PFX "Watchdog timer is now enabled.\n"); + pr_info("Watchdog timer is now enabled\n"); } static void wdt_turnoff(void) @@ -175,7 +175,7 @@ static void wdt_turnoff(void) wdt_change(WDT_DISABLE); - printk(KERN_INFO PFX "Watchdog timer is now disabled...\n"); + pr_info("Watchdog timer is now disabled...\n"); } static void wdt_keepalive(void) @@ -234,8 +234,7 @@ static int fop_close(struct inode *inode, struct file *file) wdt_turnoff(); else { del_timer(&timer); - printk(KERN_CRIT PFX - "device file closed unexpectedly. Will not stop the WDT!\n"); + pr_crit("device file closed unexpectedly. Will not stop the WDT!\n"); } clear_bit(0, &wdt_is_open); wdt_expect_close = 0; @@ -357,42 +356,37 @@ static int __init w83877f_wdt_init(void) if (timeout < 1 || timeout > 3600) { /* arbitrary upper limit */ timeout = WATCHDOG_TIMEOUT; - printk(KERN_INFO PFX - "timeout value must be 1 <= x <= 3600, using %d\n", - timeout); + pr_info("timeout value must be 1 <= x <= 3600, using %d\n", + timeout); } if (!request_region(ENABLE_W83877F_PORT, 2, "W83877F WDT")) { - printk(KERN_ERR PFX "I/O address 0x%04x already in use\n", - ENABLE_W83877F_PORT); + pr_err("I/O address 0x%04x already in use\n", + ENABLE_W83877F_PORT); rc = -EIO; goto err_out; } if (!request_region(WDT_PING, 1, "W8387FF WDT")) { - printk(KERN_ERR PFX "I/O address 0x%04x already in use\n", - WDT_PING); + pr_err("I/O address 0x%04x already in use\n", WDT_PING); rc = -EIO; goto err_out_region1; } rc = register_reboot_notifier(&wdt_notifier); if (rc) { - printk(KERN_ERR PFX - "cannot register reboot notifier (err=%d)\n", rc); + pr_err("cannot register reboot notifier (err=%d)\n", rc); goto err_out_region2; } rc = misc_register(&wdt_miscdev); if (rc) { - printk(KERN_ERR PFX - "cannot register miscdev on minor=%d (err=%d)\n", - wdt_miscdev.minor, rc); + pr_err("cannot register miscdev on minor=%d (err=%d)\n", + wdt_miscdev.minor, rc); goto err_out_reboot; } - printk(KERN_INFO PFX - "WDT driver for W83877F initialised. timeout=%d sec (nowayout=%d)\n", + pr_info("WDT driver for W83877F initialised. timeout=%d sec (nowayout=%d)\n", timeout, nowayout); return 0; |