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/f71808e_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/f71808e_wdt.c')
-rw-r--r-- | drivers/watchdog/f71808e_wdt.c | 40 |
1 files changed, 17 insertions, 23 deletions
diff --git a/drivers/watchdog/f71808e_wdt.c b/drivers/watchdog/f71808e_wdt.c index e45ca2b4bfbe..c65b0a5a020c 100644 --- a/drivers/watchdog/f71808e_wdt.c +++ b/drivers/watchdog/f71808e_wdt.c | |||
@@ -19,6 +19,8 @@ | |||
19 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * | 19 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
20 | ***************************************************************************/ | 20 | ***************************************************************************/ |
21 | 21 | ||
22 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
23 | |||
22 | #include <linux/err.h> | 24 | #include <linux/err.h> |
23 | #include <linux/fs.h> | 25 | #include <linux/fs.h> |
24 | #include <linux/init.h> | 26 | #include <linux/init.h> |
@@ -189,8 +191,7 @@ static inline int superio_enter(int base) | |||
189 | { | 191 | { |
190 | /* Don't step on other drivers' I/O space by accident */ | 192 | /* Don't step on other drivers' I/O space by accident */ |
191 | if (!request_muxed_region(base, 2, DRVNAME)) { | 193 | if (!request_muxed_region(base, 2, DRVNAME)) { |
192 | printk(KERN_ERR DRVNAME ": I/O address 0x%04x already in use\n", | 194 | pr_err("I/O address 0x%04x already in use\n", (int)base); |
193 | (int)base); | ||
194 | return -EBUSY; | 195 | return -EBUSY; |
195 | } | 196 | } |
196 | 197 | ||
@@ -217,7 +218,7 @@ static int watchdog_set_timeout(int timeout) | |||
217 | { | 218 | { |
218 | if (timeout <= 0 | 219 | if (timeout <= 0 |
219 | || timeout > max_timeout) { | 220 | || timeout > max_timeout) { |
220 | printk(KERN_ERR DRVNAME ": watchdog timeout out of range\n"); | 221 | pr_err("watchdog timeout out of range\n"); |
221 | return -EINVAL; | 222 | return -EINVAL; |
222 | } | 223 | } |
223 | 224 | ||
@@ -252,7 +253,7 @@ static int watchdog_set_pulse_width(unsigned int pw) | |||
252 | } else if (pw <= 5000) { | 253 | } else if (pw <= 5000) { |
253 | watchdog.pulse_val = 3; | 254 | watchdog.pulse_val = 3; |
254 | } else { | 255 | } else { |
255 | printk(KERN_ERR DRVNAME ": pulse width out of range\n"); | 256 | pr_err("pulse width out of range\n"); |
256 | err = -EINVAL; | 257 | err = -EINVAL; |
257 | goto exit_unlock; | 258 | goto exit_unlock; |
258 | } | 259 | } |
@@ -309,8 +310,7 @@ static int f71862fg_pin_configure(unsigned short ioaddr) | |||
309 | if (ioaddr) | 310 | if (ioaddr) |
310 | superio_set_bit(ioaddr, SIO_REG_MFUNCT1, 1); | 311 | superio_set_bit(ioaddr, SIO_REG_MFUNCT1, 1); |
311 | } else { | 312 | } else { |
312 | printk(KERN_ERR DRVNAME ": Invalid argument f71862fg_pin=%d\n", | 313 | pr_err("Invalid argument f71862fg_pin=%d\n", f71862fg_pin); |
313 | f71862fg_pin); | ||
314 | return -EINVAL; | 314 | return -EINVAL; |
315 | } | 315 | } |
316 | return 0; | 316 | return 0; |
@@ -487,8 +487,7 @@ static int watchdog_release(struct inode *inode, struct file *file) | |||
487 | 487 | ||
488 | if (!watchdog.expect_close) { | 488 | if (!watchdog.expect_close) { |
489 | watchdog_keepalive(); | 489 | watchdog_keepalive(); |
490 | printk(KERN_CRIT DRVNAME | 490 | pr_crit("Unexpected close, not stopping watchdog!\n"); |
491 | ": Unexpected close, not stopping watchdog!\n"); | ||
492 | } else if (!nowayout) { | 491 | } else if (!nowayout) { |
493 | watchdog_stop(); | 492 | watchdog_stop(); |
494 | } | 493 | } |
@@ -672,25 +671,22 @@ static int __init watchdog_init(int sioaddr) | |||
672 | 671 | ||
673 | err = misc_register(&watchdog_miscdev); | 672 | err = misc_register(&watchdog_miscdev); |
674 | if (err) { | 673 | if (err) { |
675 | printk(KERN_ERR DRVNAME | 674 | pr_err("cannot register miscdev on minor=%d\n", |
676 | ": cannot register miscdev on minor=%d\n", | 675 | watchdog_miscdev.minor); |
677 | watchdog_miscdev.minor); | ||
678 | goto exit_reboot; | 676 | goto exit_reboot; |
679 | } | 677 | } |
680 | 678 | ||
681 | if (start_withtimeout) { | 679 | if (start_withtimeout) { |
682 | if (start_withtimeout <= 0 | 680 | if (start_withtimeout <= 0 |
683 | || start_withtimeout > max_timeout) { | 681 | || start_withtimeout > max_timeout) { |
684 | printk(KERN_ERR DRVNAME | 682 | pr_err("starting timeout out of range\n"); |
685 | ": starting timeout out of range\n"); | ||
686 | err = -EINVAL; | 683 | err = -EINVAL; |
687 | goto exit_miscdev; | 684 | goto exit_miscdev; |
688 | } | 685 | } |
689 | 686 | ||
690 | err = watchdog_start(); | 687 | err = watchdog_start(); |
691 | if (err) { | 688 | if (err) { |
692 | printk(KERN_ERR DRVNAME | 689 | pr_err("cannot start watchdog timer\n"); |
693 | ": cannot start watchdog timer\n"); | ||
694 | goto exit_miscdev; | 690 | goto exit_miscdev; |
695 | } | 691 | } |
696 | 692 | ||
@@ -720,8 +716,7 @@ static int __init watchdog_init(int sioaddr) | |||
720 | if (nowayout) | 716 | if (nowayout) |
721 | __module_get(THIS_MODULE); | 717 | __module_get(THIS_MODULE); |
722 | 718 | ||
723 | printk(KERN_INFO DRVNAME | 719 | pr_info("watchdog started with initial timeout of %u sec\n", |
724 | ": watchdog started with initial timeout of %u sec\n", | ||
725 | start_withtimeout); | 720 | start_withtimeout); |
726 | } | 721 | } |
727 | 722 | ||
@@ -746,7 +741,7 @@ static int __init f71808e_find(int sioaddr) | |||
746 | 741 | ||
747 | devid = superio_inw(sioaddr, SIO_REG_MANID); | 742 | devid = superio_inw(sioaddr, SIO_REG_MANID); |
748 | if (devid != SIO_FINTEK_ID) { | 743 | if (devid != SIO_FINTEK_ID) { |
749 | pr_debug(DRVNAME ": Not a Fintek device\n"); | 744 | pr_debug("Not a Fintek device\n"); |
750 | err = -ENODEV; | 745 | err = -ENODEV; |
751 | goto exit; | 746 | goto exit; |
752 | } | 747 | } |
@@ -774,13 +769,13 @@ static int __init f71808e_find(int sioaddr) | |||
774 | err = -ENODEV; | 769 | err = -ENODEV; |
775 | goto exit; | 770 | goto exit; |
776 | default: | 771 | default: |
777 | printk(KERN_INFO DRVNAME ": Unrecognized Fintek device: %04x\n", | 772 | pr_info("Unrecognized Fintek device: %04x\n", |
778 | (unsigned int)devid); | 773 | (unsigned int)devid); |
779 | err = -ENODEV; | 774 | err = -ENODEV; |
780 | goto exit; | 775 | goto exit; |
781 | } | 776 | } |
782 | 777 | ||
783 | printk(KERN_INFO DRVNAME ": Found %s watchdog chip, revision %d\n", | 778 | pr_info("Found %s watchdog chip, revision %d\n", |
784 | f71808e_names[watchdog.type], | 779 | f71808e_names[watchdog.type], |
785 | (int)superio_inb(sioaddr, SIO_REG_DEVREV)); | 780 | (int)superio_inb(sioaddr, SIO_REG_DEVREV)); |
786 | exit: | 781 | exit: |
@@ -808,8 +803,7 @@ static int __init f71808e_init(void) | |||
808 | static void __exit f71808e_exit(void) | 803 | static void __exit f71808e_exit(void) |
809 | { | 804 | { |
810 | if (watchdog_is_running()) { | 805 | if (watchdog_is_running()) { |
811 | printk(KERN_WARNING DRVNAME | 806 | pr_warn("Watchdog timer still running, stopping it\n"); |
812 | ": Watchdog timer still running, stopping it\n"); | ||
813 | watchdog_stop(); | 807 | watchdog_stop(); |
814 | } | 808 | } |
815 | misc_deregister(&watchdog_miscdev); | 809 | misc_deregister(&watchdog_miscdev); |