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/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/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 @@ | |||
32 | * Matt Domsch : Added nowayout module option | 32 | * Matt Domsch : Added nowayout module option |
33 | */ | 33 | */ |
34 | 34 | ||
35 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
36 | |||
35 | #include <linux/interrupt.h> | 37 | #include <linux/interrupt.h> |
36 | #include <linux/module.h> | 38 | #include <linux/module.h> |
37 | #include <linux/moduleparam.h> | 39 | #include <linux/moduleparam.h> |
@@ -252,11 +254,11 @@ static int wdt_get_temperature(void) | |||
252 | static void wdt_decode_501(int status) | 254 | static void wdt_decode_501(int status) |
253 | { | 255 | { |
254 | if (!(status & WDC_SR_TGOOD)) | 256 | if (!(status & WDC_SR_TGOOD)) |
255 | printk(KERN_CRIT "Overheat alarm.(%d)\n", inb_p(WDT_RT)); | 257 | pr_crit("Overheat alarm (%d)\n", inb_p(WDT_RT)); |
256 | if (!(status & WDC_SR_PSUOVER)) | 258 | if (!(status & WDC_SR_PSUOVER)) |
257 | printk(KERN_CRIT "PSU over voltage.\n"); | 259 | pr_crit("PSU over voltage\n"); |
258 | if (!(status & WDC_SR_PSUUNDR)) | 260 | if (!(status & WDC_SR_PSUUNDR)) |
259 | printk(KERN_CRIT "PSU under voltage.\n"); | 261 | pr_crit("PSU under voltage\n"); |
260 | } | 262 | } |
261 | 263 | ||
262 | /** | 264 | /** |
@@ -280,25 +282,25 @@ static irqreturn_t wdt_interrupt(int irq, void *dev_id) | |||
280 | spin_lock(&wdt_lock); | 282 | spin_lock(&wdt_lock); |
281 | status = inb_p(WDT_SR); | 283 | status = inb_p(WDT_SR); |
282 | 284 | ||
283 | printk(KERN_CRIT "WDT status %d\n", status); | 285 | pr_crit("WDT status %d\n", status); |
284 | 286 | ||
285 | if (type == 501) { | 287 | if (type == 501) { |
286 | wdt_decode_501(status); | 288 | wdt_decode_501(status); |
287 | if (tachometer) { | 289 | if (tachometer) { |
288 | if (!(status & WDC_SR_FANGOOD)) | 290 | if (!(status & WDC_SR_FANGOOD)) |
289 | printk(KERN_CRIT "Possible fan fault.\n"); | 291 | pr_crit("Possible fan fault\n"); |
290 | } | 292 | } |
291 | } | 293 | } |
292 | if (!(status & WDC_SR_WCCR)) { | 294 | if (!(status & WDC_SR_WCCR)) { |
293 | #ifdef SOFTWARE_REBOOT | 295 | #ifdef SOFTWARE_REBOOT |
294 | #ifdef ONLY_TESTING | 296 | #ifdef ONLY_TESTING |
295 | printk(KERN_CRIT "Would Reboot.\n"); | 297 | pr_crit("Would Reboot\n"); |
296 | #else | 298 | #else |
297 | printk(KERN_CRIT "Initiating system reboot.\n"); | 299 | pr_crit("Initiating system reboot\n"); |
298 | emergency_restart(); | 300 | emergency_restart(); |
299 | #endif | 301 | #endif |
300 | #else | 302 | #else |
301 | printk(KERN_CRIT "Reset in 5ms.\n"); | 303 | pr_crit("Reset in 5ms\n"); |
302 | #endif | 304 | #endif |
303 | } | 305 | } |
304 | spin_unlock(&wdt_lock); | 306 | spin_unlock(&wdt_lock); |
@@ -441,8 +443,7 @@ static int wdt_release(struct inode *inode, struct file *file) | |||
441 | wdt_stop(); | 443 | wdt_stop(); |
442 | clear_bit(0, &wdt_is_open); | 444 | clear_bit(0, &wdt_is_open); |
443 | } else { | 445 | } else { |
444 | printk(KERN_CRIT | 446 | pr_crit("WDT device closed unexpectedly. WDT will not stop!\n"); |
445 | "wdt: WDT device closed unexpectedly. WDT will not stop!\n"); | ||
446 | wdt_ping(); | 447 | wdt_ping(); |
447 | } | 448 | } |
448 | expect_close = 0; | 449 | expect_close = 0; |
@@ -593,7 +594,7 @@ static int __init wdt_init(void) | |||
593 | int ret; | 594 | int ret; |
594 | 595 | ||
595 | if (type != 500 && type != 501) { | 596 | if (type != 500 && type != 501) { |
596 | printk(KERN_ERR "wdt: unknown card type '%d'.\n", type); | 597 | pr_err("unknown card type '%d'\n", type); |
597 | return -ENODEV; | 598 | return -ENODEV; |
598 | } | 599 | } |
599 | 600 | ||
@@ -601,53 +602,49 @@ static int __init wdt_init(void) | |||
601 | if not reset to the default */ | 602 | if not reset to the default */ |
602 | if (wdt_set_heartbeat(heartbeat)) { | 603 | if (wdt_set_heartbeat(heartbeat)) { |
603 | wdt_set_heartbeat(WD_TIMO); | 604 | wdt_set_heartbeat(WD_TIMO); |
604 | printk(KERN_INFO "wdt: heartbeat value must be " | 605 | pr_info("heartbeat value must be 0 < heartbeat < 65536, using %d\n", |
605 | "0 < heartbeat < 65536, using %d\n", WD_TIMO); | 606 | WD_TIMO); |
606 | } | 607 | } |
607 | 608 | ||
608 | if (!request_region(io, 8, "wdt501p")) { | 609 | if (!request_region(io, 8, "wdt501p")) { |
609 | printk(KERN_ERR | 610 | pr_err("I/O address 0x%04x already in use\n", io); |
610 | "wdt: I/O address 0x%04x already in use\n", io); | ||
611 | ret = -EBUSY; | 611 | ret = -EBUSY; |
612 | goto out; | 612 | goto out; |
613 | } | 613 | } |
614 | 614 | ||
615 | ret = request_irq(irq, wdt_interrupt, 0, "wdt501p", NULL); | 615 | ret = request_irq(irq, wdt_interrupt, 0, "wdt501p", NULL); |
616 | if (ret) { | 616 | if (ret) { |
617 | printk(KERN_ERR "wdt: IRQ %d is not free.\n", irq); | 617 | pr_err("IRQ %d is not free\n", irq); |
618 | goto outreg; | 618 | goto outreg; |
619 | } | 619 | } |
620 | 620 | ||
621 | ret = register_reboot_notifier(&wdt_notifier); | 621 | ret = register_reboot_notifier(&wdt_notifier); |
622 | if (ret) { | 622 | if (ret) { |
623 | printk(KERN_ERR | 623 | pr_err("cannot register reboot notifier (err=%d)\n", ret); |
624 | "wdt: cannot register reboot notifier (err=%d)\n", ret); | ||
625 | goto outirq; | 624 | goto outirq; |
626 | } | 625 | } |
627 | 626 | ||
628 | if (type == 501) { | 627 | if (type == 501) { |
629 | ret = misc_register(&temp_miscdev); | 628 | ret = misc_register(&temp_miscdev); |
630 | if (ret) { | 629 | if (ret) { |
631 | printk(KERN_ERR "wdt: cannot register miscdev " | 630 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
632 | "on minor=%d (err=%d)\n", TEMP_MINOR, ret); | 631 | TEMP_MINOR, ret); |
633 | goto outrbt; | 632 | goto outrbt; |
634 | } | 633 | } |
635 | } | 634 | } |
636 | 635 | ||
637 | ret = misc_register(&wdt_miscdev); | 636 | ret = misc_register(&wdt_miscdev); |
638 | if (ret) { | 637 | if (ret) { |
639 | printk(KERN_ERR | 638 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
640 | "wdt: cannot register miscdev on minor=%d (err=%d)\n", | 639 | WATCHDOG_MINOR, ret); |
641 | WATCHDOG_MINOR, ret); | ||
642 | goto outmisc; | 640 | goto outmisc; |
643 | } | 641 | } |
644 | 642 | ||
645 | printk(KERN_INFO "WDT500/501-P driver 0.10 " | 643 | pr_info("WDT500/501-P driver 0.10 at 0x%04x (Interrupt %d). heartbeat=%d sec (nowayout=%d)\n", |
646 | "at 0x%04x (Interrupt %d). heartbeat=%d sec (nowayout=%d)\n", | ||
647 | io, irq, heartbeat, nowayout); | 644 | io, irq, heartbeat, nowayout); |
648 | if (type == 501) | 645 | if (type == 501) |
649 | printk(KERN_INFO "wdt: Fan Tachometer is %s\n", | 646 | pr_info("Fan Tachometer is %s\n", |
650 | (tachometer ? "Enabled" : "Disabled")); | 647 | tachometer ? "Enabled" : "Disabled"); |
651 | return 0; | 648 | return 0; |
652 | 649 | ||
653 | outmisc: | 650 | outmisc: |