diff options
author | Joe Perches <joe@perches.com> | 2012-02-16 03:06:19 +0400 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2012-03-27 21:59:26 +0400 |
commit | 27c766aaacb265d625dc634bf7903f7f9fd0c697 (patch) | |
tree | 06b399d21dec006bc0a3e1c6685b076753e19b94 /drivers/watchdog/wdt.c | |
parent | 7cbc353540c31ffaf65ad44d89b955be0f1d04dc (diff) | |
download | linux-27c766aaacb265d625dc634bf7903f7f9fd0c697.tar.xz |
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/wdt.c')
-rw-r--r-- | drivers/watchdog/wdt.c | 51 |
1 files changed, 24 insertions, 27 deletions
diff --git a/drivers/watchdog/wdt.c b/drivers/watchdog/wdt.c index d2ef002be96b..4ef6702fff82 100644 --- a/drivers/watchdog/wdt.c +++ b/drivers/watchdog/wdt.c @@ -32,6 +32,8 @@ * Matt Domsch : Added nowayout module option */ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + #include <linux/interrupt.h> #include <linux/module.h> #include <linux/moduleparam.h> @@ -252,11 +254,11 @@ static int wdt_get_temperature(void) static void wdt_decode_501(int status) { if (!(status & WDC_SR_TGOOD)) - printk(KERN_CRIT "Overheat alarm.(%d)\n", inb_p(WDT_RT)); + pr_crit("Overheat alarm (%d)\n", inb_p(WDT_RT)); if (!(status & WDC_SR_PSUOVER)) - printk(KERN_CRIT "PSU over voltage.\n"); + pr_crit("PSU over voltage\n"); if (!(status & WDC_SR_PSUUNDR)) - printk(KERN_CRIT "PSU under voltage.\n"); + pr_crit("PSU under voltage\n"); } /** @@ -280,25 +282,25 @@ static irqreturn_t wdt_interrupt(int irq, void *dev_id) spin_lock(&wdt_lock); status = inb_p(WDT_SR); - printk(KERN_CRIT "WDT status %d\n", status); + pr_crit("WDT status %d\n", status); if (type == 501) { wdt_decode_501(status); if (tachometer) { if (!(status & WDC_SR_FANGOOD)) - printk(KERN_CRIT "Possible fan fault.\n"); + pr_crit("Possible fan fault\n"); } } if (!(status & WDC_SR_WCCR)) { #ifdef SOFTWARE_REBOOT #ifdef ONLY_TESTING - printk(KERN_CRIT "Would Reboot.\n"); + pr_crit("Would Reboot\n"); #else - printk(KERN_CRIT "Initiating system reboot.\n"); + pr_crit("Initiating system reboot\n"); emergency_restart(); #endif #else - printk(KERN_CRIT "Reset in 5ms.\n"); + pr_crit("Reset in 5ms\n"); #endif } spin_unlock(&wdt_lock); @@ -441,8 +443,7 @@ static int wdt_release(struct inode *inode, struct file *file) wdt_stop(); clear_bit(0, &wdt_is_open); } else { - printk(KERN_CRIT - "wdt: WDT device closed unexpectedly. WDT will not stop!\n"); + pr_crit("WDT device closed unexpectedly. WDT will not stop!\n"); wdt_ping(); } expect_close = 0; @@ -593,7 +594,7 @@ static int __init wdt_init(void) int ret; if (type != 500 && type != 501) { - printk(KERN_ERR "wdt: unknown card type '%d'.\n", type); + pr_err("unknown card type '%d'\n", type); return -ENODEV; } @@ -601,53 +602,49 @@ static int __init wdt_init(void) if not reset to the default */ if (wdt_set_heartbeat(heartbeat)) { wdt_set_heartbeat(WD_TIMO); - printk(KERN_INFO "wdt: heartbeat value must be " - "0 < heartbeat < 65536, using %d\n", WD_TIMO); + pr_info("heartbeat value must be 0 < heartbeat < 65536, using %d\n", + WD_TIMO); } if (!request_region(io, 8, "wdt501p")) { - printk(KERN_ERR - "wdt: I/O address 0x%04x already in use\n", io); + pr_err("I/O address 0x%04x already in use\n", io); ret = -EBUSY; goto out; } ret = request_irq(irq, wdt_interrupt, 0, "wdt501p", NULL); if (ret) { - printk(KERN_ERR "wdt: IRQ %d is not free.\n", irq); + pr_err("IRQ %d is not free\n", irq); goto outreg; } ret = register_reboot_notifier(&wdt_notifier); if (ret) { - printk(KERN_ERR - "wdt: cannot register reboot notifier (err=%d)\n", ret); + pr_err("cannot register reboot notifier (err=%d)\n", ret); goto outirq; } if (type == 501) { ret = misc_register(&temp_miscdev); if (ret) { - printk(KERN_ERR "wdt: cannot register miscdev " - "on minor=%d (err=%d)\n", TEMP_MINOR, ret); + pr_err("cannot register miscdev on minor=%d (err=%d)\n", + TEMP_MINOR, ret); goto outrbt; } } ret = misc_register(&wdt_miscdev); if (ret) { - printk(KERN_ERR - "wdt: 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 outmisc; } - printk(KERN_INFO "WDT500/501-P driver 0.10 " - "at 0x%04x (Interrupt %d). heartbeat=%d sec (nowayout=%d)\n", + pr_info("WDT500/501-P driver 0.10 at 0x%04x (Interrupt %d). heartbeat=%d sec (nowayout=%d)\n", io, irq, heartbeat, nowayout); if (type == 501) - printk(KERN_INFO "wdt: Fan Tachometer is %s\n", - (tachometer ? "Enabled" : "Disabled")); + pr_info("Fan Tachometer is %s\n", + tachometer ? "Enabled" : "Disabled"); return 0; outmisc: |