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/i6300esb.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/i6300esb.c')
-rw-r--r-- | drivers/watchdog/i6300esb.c | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/drivers/watchdog/i6300esb.c b/drivers/watchdog/i6300esb.c index db45091ef434..15548e622754 100644 --- a/drivers/watchdog/i6300esb.c +++ b/drivers/watchdog/i6300esb.c @@ -27,6 +27,8 @@ * Includes, defines, variables, module parameters, ... */ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + #include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h> @@ -44,7 +46,6 @@ #define ESB_VERSION "0.05" #define ESB_MODULE_NAME "i6300ESB timer" #define ESB_DRIVER_NAME ESB_MODULE_NAME ", v" ESB_VERSION -#define PFX ESB_MODULE_NAME ": " /* PCI configuration registers */ #define ESB_CONFIG_REG 0x60 /* Config register */ @@ -213,8 +214,7 @@ static int esb_release(struct inode *inode, struct file *file) if (esb_expect_close == 42) esb_timer_stop(); else { - printk(KERN_CRIT PFX - "Unexpected close, not stopping watchdog!\n"); + pr_crit("Unexpected close, not stopping watchdog!\n"); esb_timer_keepalive(); } clear_bit(0, &timer_alive); @@ -347,19 +347,19 @@ MODULE_DEVICE_TABLE(pci, esb_pci_tbl); static unsigned char __devinit esb_getdevice(struct pci_dev *pdev) { if (pci_enable_device(pdev)) { - printk(KERN_ERR PFX "failed to enable device\n"); + pr_err("failed to enable device\n"); goto err_devput; } if (pci_request_region(pdev, 0, ESB_MODULE_NAME)) { - printk(KERN_ERR PFX "failed to request region\n"); + pr_err("failed to request region\n"); goto err_disable; } BASEADDR = pci_ioremap_bar(pdev, 0); if (BASEADDR == NULL) { /* Something's wrong here, BASEADDR has to be set */ - printk(KERN_ERR PFX "failed to get BASEADDR\n"); + pr_err("failed to get BASEADDR\n"); goto err_release; } @@ -397,7 +397,7 @@ static void __devinit esb_initdevice(void) /* Check that the WDT isn't already locked */ pci_read_config_byte(esb_pci, ESB_LOCK_REG, &val1); if (val1 & ESB_WDT_LOCK) - printk(KERN_WARNING PFX "nowayout already set\n"); + pr_warn("nowayout already set\n"); /* Set the timer to watchdog mode and disable it for now */ pci_write_config_byte(esb_pci, ESB_LOCK_REG, 0x00); @@ -423,11 +423,11 @@ static int __devinit esb_probe(struct pci_dev *pdev, cards_found++; if (cards_found == 1) - printk(KERN_INFO PFX "Intel 6300ESB WatchDog Timer Driver v%s\n", + pr_info("Intel 6300ESB WatchDog Timer Driver v%s\n", ESB_VERSION); if (cards_found > 1) { - printk(KERN_ERR PFX "This driver only supports 1 device\n"); + pr_err("This driver only supports 1 device\n"); return -ENODEV; } @@ -439,9 +439,8 @@ static int __devinit esb_probe(struct pci_dev *pdev, if not reset to the default */ if (heartbeat < 0x1 || heartbeat > 2 * 0x03ff) { heartbeat = WATCHDOG_HEARTBEAT; - printk(KERN_INFO PFX - "heartbeat value must be 1<heartbeat<2046, using %d\n", - heartbeat); + pr_info("heartbeat value must be 1<heartbeat<2046, using %d\n", + heartbeat); } /* Initialize the watchdog and make sure it does not run */ @@ -450,14 +449,12 @@ static int __devinit esb_probe(struct pci_dev *pdev, /* Register the watchdog so that userspace has access to it */ ret = misc_register(&esb_miscdev); if (ret != 0) { - printk(KERN_ERR PFX - "cannot register miscdev on minor=%d (err=%d)\n", - WATCHDOG_MINOR, ret); + pr_err("cannot register miscdev on minor=%d (err=%d)\n", + WATCHDOG_MINOR, ret); goto err_unmap; } - printk(KERN_INFO PFX - "initialized (0x%p). heartbeat=%d sec (nowayout=%d)\n", - BASEADDR, heartbeat, nowayout); + pr_info("initialized (0x%p). heartbeat=%d sec (nowayout=%d)\n", + BASEADDR, heartbeat, nowayout); return 0; err_unmap: @@ -503,7 +500,7 @@ static int __init watchdog_init(void) static void __exit watchdog_cleanup(void) { pci_unregister_driver(&esb_driver); - printk(KERN_INFO PFX "Watchdog Module Unloaded.\n"); + pr_info("Watchdog Module Unloaded\n"); } module_init(watchdog_init); |