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/sbc7240_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/sbc7240_wdt.c')
-rw-r--r-- | drivers/watchdog/sbc7240_wdt.c | 40 |
1 files changed, 15 insertions, 25 deletions
diff --git a/drivers/watchdog/sbc7240_wdt.c b/drivers/watchdog/sbc7240_wdt.c index 93ac58953122..77cb302754db 100644 --- a/drivers/watchdog/sbc7240_wdt.c +++ b/drivers/watchdog/sbc7240_wdt.c @@ -16,6 +16,8 @@ * */ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + #include <linux/fs.h> #include <linux/init.h> #include <linux/ioport.h> @@ -32,8 +34,6 @@ #include <linux/atomic.h> #include <asm/system.h> -#define SBC7240_PREFIX "sbc7240_wdt: " - #define SBC7240_ENABLE_PORT 0x443 #define SBC7240_DISABLE_PORT 0x043 #define SBC7240_SET_TIMEOUT_PORT SBC7240_ENABLE_PORT @@ -65,8 +65,7 @@ static void wdt_disable(void) /* disable the watchdog */ if (test_and_clear_bit(SBC7240_ENABLED_STATUS_BIT, &wdt_status)) { inb_p(SBC7240_DISABLE_PORT); - printk(KERN_INFO SBC7240_PREFIX - "Watchdog timer is now disabled.\n"); + pr_info("Watchdog timer is now disabled\n"); } } @@ -75,23 +74,20 @@ static void wdt_enable(void) /* enable the watchdog */ if (!test_and_set_bit(SBC7240_ENABLED_STATUS_BIT, &wdt_status)) { inb_p(SBC7240_ENABLE_PORT); - printk(KERN_INFO SBC7240_PREFIX - "Watchdog timer is now enabled.\n"); + pr_info("Watchdog timer is now enabled\n"); } } static int wdt_set_timeout(int t) { if (t < 1 || t > SBC7240_MAX_TIMEOUT) { - printk(KERN_ERR SBC7240_PREFIX - "timeout value must be 1<=x<=%d\n", - SBC7240_MAX_TIMEOUT); + pr_err("timeout value must be 1<=x<=%d\n", SBC7240_MAX_TIMEOUT); return -1; } /* set the timeout */ outb_p((unsigned)t, SBC7240_SET_TIMEOUT_PORT); timeout = t; - printk(KERN_INFO SBC7240_PREFIX "timeout set to %d seconds\n", t); + pr_info("timeout set to %d seconds\n", t); return 0; } @@ -150,8 +146,7 @@ static int fop_close(struct inode *inode, struct file *file) || !nowayout) { wdt_disable(); } else { - printk(KERN_CRIT SBC7240_PREFIX - "Unexpected close, not stopping watchdog!\n"); + pr_crit("Unexpected close, not stopping watchdog!\n"); wdt_keepalive(); } @@ -252,7 +247,7 @@ static struct notifier_block wdt_notifier = { static void __exit sbc7240_wdt_unload(void) { - printk(KERN_INFO SBC7240_PREFIX "Removing watchdog\n"); + pr_info("Removing watchdog\n"); misc_deregister(&wdt_miscdev); unregister_reboot_notifier(&wdt_notifier); @@ -264,8 +259,7 @@ static int __init sbc7240_wdt_init(void) int rc = -EBUSY; if (!request_region(SBC7240_ENABLE_PORT, 1, "SBC7240 WDT")) { - printk(KERN_ERR SBC7240_PREFIX - "I/O address 0x%04x already in use\n", + pr_err("I/O address 0x%04x already in use\n", SBC7240_ENABLE_PORT); rc = -EIO; goto err_out; @@ -277,31 +271,27 @@ static int __init sbc7240_wdt_init(void) if (timeout < 1 || timeout > SBC7240_MAX_TIMEOUT) { timeout = SBC7240_TIMEOUT; - printk(KERN_INFO SBC7240_PREFIX - "timeout value must be 1<=x<=%d, using %d\n", - SBC7240_MAX_TIMEOUT, timeout); + pr_info("timeout value must be 1<=x<=%d, using %d\n", + SBC7240_MAX_TIMEOUT, timeout); } wdt_set_timeout(timeout); wdt_disable(); rc = register_reboot_notifier(&wdt_notifier); if (rc) { - printk(KERN_ERR SBC7240_PREFIX - "cannot register reboot notifier (err=%d)\n", rc); + pr_err("cannot register reboot notifier (err=%d)\n", rc); goto err_out_region; } rc = misc_register(&wdt_miscdev); if (rc) { - printk(KERN_ERR SBC7240_PREFIX - "cannot register miscdev on minor=%d (err=%d)\n", + pr_err("cannot register miscdev on minor=%d (err=%d)\n", wdt_miscdev.minor, rc); goto err_out_reboot_notifier; } - printk(KERN_INFO SBC7240_PREFIX - "Watchdog driver for SBC7240 initialised (nowayout=%d)\n", - nowayout); + pr_info("Watchdog driver for SBC7240 initialised (nowayout=%d)\n", + nowayout); return 0; |