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/sp5100_tco.c | |
parent | 7cbc353540c31ffaf65ad44d89b955be0f1d04dc (diff) | |
download | blackbird-op-linux-27c766aaacb265d625dc634bf7903f7f9fd0c697.tar.gz blackbird-op-linux-27c766aaacb265d625dc634bf7903f7f9fd0c697.zip |
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/sp5100_tco.c')
-rw-r--r-- | drivers/watchdog/sp5100_tco.c | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/drivers/watchdog/sp5100_tco.c b/drivers/watchdog/sp5100_tco.c index 87e0527669d8..954a7b6334c4 100644 --- a/drivers/watchdog/sp5100_tco.c +++ b/drivers/watchdog/sp5100_tco.c @@ -20,6 +20,8 @@ * Includes, defines, variables, module parameters, ... */ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/types.h> @@ -39,7 +41,6 @@ #define TCO_VERSION "0.01" #define TCO_MODULE_NAME "SP5100 TCO timer" #define TCO_DRIVER_NAME TCO_MODULE_NAME ", v" TCO_VERSION -#define PFX TCO_MODULE_NAME ": " /* internal variables */ static u32 tcobase_phys; @@ -143,8 +144,7 @@ static int sp5100_tco_release(struct inode *inode, struct file *file) if (tco_expect_close == 42) { tco_timer_stop(); } else { - printk(KERN_CRIT PFX - "Unexpected close, not stopping watchdog!\n"); + pr_crit("Unexpected close, not stopping watchdog!\n"); tco_timer_keepalive(); } clear_bit(0, &timer_alive); @@ -290,8 +290,7 @@ static unsigned char __devinit sp5100_tco_setupdevice(void) /* Request the IO ports used by this driver */ pm_iobase = SP5100_IO_PM_INDEX_REG; if (!request_region(pm_iobase, SP5100_PM_IOPORTS_SIZE, "SP5100 TCO")) { - printk(KERN_ERR PFX "I/O address 0x%04x already in use\n", - pm_iobase); + pr_err("I/O address 0x%04x already in use\n", pm_iobase); goto exit; } @@ -308,15 +307,14 @@ static unsigned char __devinit sp5100_tco_setupdevice(void) if (!request_mem_region_exclusive(val, SP5100_WDT_MEM_MAP_SIZE, "SP5100 TCO")) { - printk(KERN_ERR PFX "mmio address 0x%04x already in use\n", - val); + pr_err("mmio address 0x%04x already in use\n", val); goto unreg_region; } tcobase_phys = val; tcobase = ioremap(val, SP5100_WDT_MEM_MAP_SIZE); if (tcobase == 0) { - printk(KERN_ERR PFX "failed to get tcobase address\n"); + pr_err("failed to get tcobase address\n"); goto unreg_mem_region; } @@ -375,9 +373,9 @@ static int __devinit sp5100_tco_init(struct platform_device *dev) return -ENODEV; /* Check to see if last reboot was due to watchdog timeout */ - printk(KERN_INFO PFX "Watchdog reboot %sdetected.\n", - readl(SP5100_WDT_CONTROL(tcobase)) & SP5100_PM_WATCHDOG_FIRED ? - "" : "not "); + pr_info("Watchdog reboot %sdetected\n", + readl(SP5100_WDT_CONTROL(tcobase)) & SP5100_PM_WATCHDOG_FIRED ? + "" : "not "); /* Clear out the old status */ val = readl(SP5100_WDT_CONTROL(tcobase)); @@ -395,16 +393,14 @@ static int __devinit sp5100_tco_init(struct platform_device *dev) ret = misc_register(&sp5100_tco_miscdev); if (ret != 0) { - printk(KERN_ERR PFX "cannot register miscdev on minor=" - "%d (err=%d)\n", + pr_err("cannot register miscdev on minor=%d (err=%d)\n", WATCHDOG_MINOR, ret); goto exit; } clear_bit(0, &timer_alive); - printk(KERN_INFO PFX "initialized (0x%p). heartbeat=%d sec" - " (nowayout=%d)\n", + pr_info("initialized (0x%p). heartbeat=%d sec (nowayout=%d)\n", tcobase, heartbeat, nowayout); return 0; @@ -455,8 +451,7 @@ static int __init sp5100_tco_init_module(void) { int err; - printk(KERN_INFO PFX "SP5100 TCO WatchDog Timer Driver v%s\n", - TCO_VERSION); + pr_info("SP5100 TCO WatchDog Timer Driver v%s\n", TCO_VERSION); err = platform_driver_register(&sp5100_tco_driver); if (err) @@ -480,7 +475,7 @@ static void __exit sp5100_tco_cleanup_module(void) { platform_device_unregister(sp5100_tco_platform_device); platform_driver_unregister(&sp5100_tco_driver); - printk(KERN_INFO PFX "SP5100 TCO Watchdog Module Unloaded.\n"); + pr_info("SP5100 TCO Watchdog Module Unloaded\n"); } module_init(sp5100_tco_init_module); |