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/smsc37b787_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/smsc37b787_wdt.c')
-rw-r--r-- | drivers/watchdog/smsc37b787_wdt.c | 38 |
1 files changed, 16 insertions, 22 deletions
diff --git a/drivers/watchdog/smsc37b787_wdt.c b/drivers/watchdog/smsc37b787_wdt.c index 97b8184614ae..5e4d3734b516 100644 --- a/drivers/watchdog/smsc37b787_wdt.c +++ b/drivers/watchdog/smsc37b787_wdt.c | |||
@@ -43,6 +43,8 @@ | |||
43 | * Documentation/watchdog/wdt.txt | 43 | * Documentation/watchdog/wdt.txt |
44 | */ | 44 | */ |
45 | 45 | ||
46 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
47 | |||
46 | #include <linux/module.h> | 48 | #include <linux/module.h> |
47 | #include <linux/moduleparam.h> | 49 | #include <linux/moduleparam.h> |
48 | #include <linux/types.h> | 50 | #include <linux/types.h> |
@@ -70,7 +72,6 @@ | |||
70 | #define UNIT_SECOND 0 | 72 | #define UNIT_SECOND 0 |
71 | #define UNIT_MINUTE 1 | 73 | #define UNIT_MINUTE 1 |
72 | 74 | ||
73 | #define MODNAME "smsc37b787_wdt: " | ||
74 | #define VERSION "1.1" | 75 | #define VERSION "1.1" |
75 | 76 | ||
76 | #define IOPORT 0x3F0 | 77 | #define IOPORT 0x3F0 |
@@ -363,8 +364,7 @@ static int wb_smsc_wdt_open(struct inode *inode, struct file *file) | |||
363 | /* Reload and activate timer */ | 364 | /* Reload and activate timer */ |
364 | wb_smsc_wdt_enable(); | 365 | wb_smsc_wdt_enable(); |
365 | 366 | ||
366 | printk(KERN_INFO MODNAME | 367 | pr_info("Watchdog enabled. Timeout set to %d %s\n", |
367 | "Watchdog enabled. Timeout set to %d %s.\n", | ||
368 | timeout, (unit == UNIT_SECOND) ? "second(s)" : "minute(s)"); | 368 | timeout, (unit == UNIT_SECOND) ? "second(s)" : "minute(s)"); |
369 | 369 | ||
370 | return nonseekable_open(inode, file); | 370 | return nonseekable_open(inode, file); |
@@ -378,11 +378,9 @@ static int wb_smsc_wdt_release(struct inode *inode, struct file *file) | |||
378 | 378 | ||
379 | if (expect_close == 42) { | 379 | if (expect_close == 42) { |
380 | wb_smsc_wdt_disable(); | 380 | wb_smsc_wdt_disable(); |
381 | printk(KERN_INFO MODNAME | 381 | pr_info("Watchdog disabled, sleeping again...\n"); |
382 | "Watchdog disabled, sleeping again...\n"); | ||
383 | } else { | 382 | } else { |
384 | printk(KERN_CRIT MODNAME | 383 | pr_crit("Unexpected close, not stopping watchdog!\n"); |
385 | "Unexpected close, not stopping watchdog!\n"); | ||
386 | wb_smsc_wdt_reset_timer(); | 384 | wb_smsc_wdt_reset_timer(); |
387 | } | 385 | } |
388 | 386 | ||
@@ -534,12 +532,11 @@ static int __init wb_smsc_wdt_init(void) | |||
534 | { | 532 | { |
535 | int ret; | 533 | int ret; |
536 | 534 | ||
537 | printk(KERN_INFO "SMsC 37B787 watchdog component driver " | 535 | pr_info("SMsC 37B787 watchdog component driver " |
538 | VERSION " initialising...\n"); | 536 | VERSION " initialising...\n"); |
539 | 537 | ||
540 | if (!request_region(IOPORT, IOPORT_SIZE, "SMsC 37B787 watchdog")) { | 538 | if (!request_region(IOPORT, IOPORT_SIZE, "SMsC 37B787 watchdog")) { |
541 | printk(KERN_ERR MODNAME "Unable to register IO port %#x\n", | 539 | pr_err("Unable to register IO port %#x\n", IOPORT); |
542 | IOPORT); | ||
543 | ret = -EBUSY; | 540 | ret = -EBUSY; |
544 | goto out_pnp; | 541 | goto out_pnp; |
545 | } | 542 | } |
@@ -553,25 +550,22 @@ static int __init wb_smsc_wdt_init(void) | |||
553 | 550 | ||
554 | ret = register_reboot_notifier(&wb_smsc_wdt_notifier); | 551 | ret = register_reboot_notifier(&wb_smsc_wdt_notifier); |
555 | if (ret) { | 552 | if (ret) { |
556 | printk(KERN_ERR MODNAME | 553 | pr_err("Unable to register reboot notifier err = %d\n", ret); |
557 | "Unable to register reboot notifier err = %d\n", ret); | ||
558 | goto out_io; | 554 | goto out_io; |
559 | } | 555 | } |
560 | 556 | ||
561 | ret = misc_register(&wb_smsc_wdt_miscdev); | 557 | ret = misc_register(&wb_smsc_wdt_miscdev); |
562 | if (ret) { | 558 | if (ret) { |
563 | printk(KERN_ERR MODNAME | 559 | pr_err("Unable to register miscdev on minor %d\n", |
564 | "Unable to register miscdev on minor %d\n", | 560 | WATCHDOG_MINOR); |
565 | WATCHDOG_MINOR); | ||
566 | goto out_rbt; | 561 | goto out_rbt; |
567 | } | 562 | } |
568 | 563 | ||
569 | /* output info */ | 564 | /* output info */ |
570 | printk(KERN_INFO MODNAME "Timeout set to %d %s.\n", | 565 | pr_info("Timeout set to %d %s\n", |
571 | timeout, (unit == UNIT_SECOND) ? "second(s)" : "minute(s)"); | 566 | timeout, (unit == UNIT_SECOND) ? "second(s)" : "minute(s)"); |
572 | printk(KERN_INFO MODNAME | 567 | pr_info("Watchdog initialized and sleeping (nowayout=%d)...\n", |
573 | "Watchdog initialized and sleeping (nowayout=%d)...\n", | 568 | nowayout); |
574 | nowayout); | ||
575 | out_clean: | 569 | out_clean: |
576 | return ret; | 570 | return ret; |
577 | 571 | ||
@@ -592,14 +586,14 @@ static void __exit wb_smsc_wdt_exit(void) | |||
592 | /* Stop the timer before we leave */ | 586 | /* Stop the timer before we leave */ |
593 | if (!nowayout) { | 587 | if (!nowayout) { |
594 | wb_smsc_wdt_shutdown(); | 588 | wb_smsc_wdt_shutdown(); |
595 | printk(KERN_INFO MODNAME "Watchdog disabled.\n"); | 589 | pr_info("Watchdog disabled\n"); |
596 | } | 590 | } |
597 | 591 | ||
598 | misc_deregister(&wb_smsc_wdt_miscdev); | 592 | misc_deregister(&wb_smsc_wdt_miscdev); |
599 | unregister_reboot_notifier(&wb_smsc_wdt_notifier); | 593 | unregister_reboot_notifier(&wb_smsc_wdt_notifier); |
600 | release_region(IOPORT, IOPORT_SIZE); | 594 | release_region(IOPORT, IOPORT_SIZE); |
601 | 595 | ||
602 | printk(KERN_INFO "SMsC 37B787 watchdog component driver removed.\n"); | 596 | pr_info("SMsC 37B787 watchdog component driver removed\n"); |
603 | } | 597 | } |
604 | 598 | ||
605 | module_init(wb_smsc_wdt_init); | 599 | module_init(wb_smsc_wdt_init); |