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 | |
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')
90 files changed, 1039 insertions, 1280 deletions
diff --git a/drivers/watchdog/acquirewdt.c b/drivers/watchdog/acquirewdt.c index b6a2b58cbe6..8947ccd71ef 100644 --- a/drivers/watchdog/acquirewdt.c +++ b/drivers/watchdog/acquirewdt.c @@ -52,6 +52,8 @@ * Includes, defines, variables, module parameters, ... */ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + /* Includes */ #include <linux/module.h> /* For module specific items */ #include <linux/moduleparam.h> /* For new moduleparam's */ @@ -70,7 +72,6 @@ /* Module information */ #define DRV_NAME "acquirewdt" -#define PFX DRV_NAME ": " #define WATCHDOG_NAME "Acquire WDT" /* There is no way to see what the correct time-out period is */ #define WATCHDOG_HEARTBEAT 0 @@ -208,8 +209,7 @@ static int acq_close(struct inode *inode, struct file *file) if (expect_close == 42) { acq_stop(); } else { - printk(KERN_CRIT PFX - "Unexpected close, not stopping watchdog!\n"); + pr_crit("Unexpected close, not stopping watchdog!\n"); acq_keepalive(); } clear_bit(0, &acq_is_open); @@ -246,27 +246,24 @@ static int __devinit acq_probe(struct platform_device *dev) if (wdt_stop != wdt_start) { if (!request_region(wdt_stop, 1, WATCHDOG_NAME)) { - printk(KERN_ERR PFX - "I/O address 0x%04x already in use\n", wdt_stop); + pr_err("I/O address 0x%04x already in use\n", wdt_stop); ret = -EIO; goto out; } } if (!request_region(wdt_start, 1, WATCHDOG_NAME)) { - printk(KERN_ERR PFX "I/O address 0x%04x already in use\n", - wdt_start); + pr_err("I/O address 0x%04x already in use\n", wdt_start); ret = -EIO; goto unreg_stop; } ret = misc_register(&acq_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 unreg_regions; } - printk(KERN_INFO PFX "initialized. (nowayout=%d)\n", nowayout); + pr_info("initialized. (nowayout=%d)\n", nowayout); return 0; unreg_regions: @@ -308,8 +305,7 @@ static int __init acq_init(void) { int err; - printk(KERN_INFO - "WDT driver for Acquire single board computer initialising.\n"); + pr_info("WDT driver for Acquire single board computer initialising\n"); err = platform_driver_register(&acquirewdt_driver); if (err) @@ -332,7 +328,7 @@ static void __exit acq_exit(void) { platform_device_unregister(acq_platform_device); platform_driver_unregister(&acquirewdt_driver); - printk(KERN_INFO PFX "Watchdog Module Unloaded.\n"); + pr_info("Watchdog Module Unloaded\n"); } module_init(acq_init); diff --git a/drivers/watchdog/advantechwdt.c b/drivers/watchdog/advantechwdt.c index 4d40965d2c9..986258a0667 100644 --- a/drivers/watchdog/advantechwdt.c +++ b/drivers/watchdog/advantechwdt.c @@ -28,6 +28,8 @@ * add wdt_start and wdt_stop as parameters. */ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/types.h> @@ -43,7 +45,6 @@ #include <asm/system.h> #define DRV_NAME "advantechwdt" -#define PFX DRV_NAME ": " #define WATCHDOG_NAME "Advantech WDT" #define WATCHDOG_TIMEOUT 60 /* 60 sec default timeout */ @@ -207,8 +208,7 @@ static int advwdt_close(struct inode *inode, struct file *file) if (adv_expect_close == 42) { advwdt_disable(); } else { - printk(KERN_CRIT PFX - "Unexpected close, not stopping watchdog!\n"); + pr_crit("Unexpected close, not stopping watchdog!\n"); advwdt_ping(); } clear_bit(0, &advwdt_is_open); @@ -245,18 +245,15 @@ static int __devinit advwdt_probe(struct platform_device *dev) if (wdt_stop != wdt_start) { if (!request_region(wdt_stop, 1, WATCHDOG_NAME)) { - printk(KERN_ERR PFX - "I/O address 0x%04x already in use\n", - wdt_stop); + pr_err("I/O address 0x%04x already in use\n", + wdt_stop); ret = -EIO; goto out; } } if (!request_region(wdt_start, 1, WATCHDOG_NAME)) { - printk(KERN_ERR PFX - "I/O address 0x%04x already in use\n", - wdt_start); + pr_err("I/O address 0x%04x already in use\n", wdt_start); ret = -EIO; goto unreg_stop; } @@ -265,18 +262,16 @@ static int __devinit advwdt_probe(struct platform_device *dev) * if not reset to the default */ if (advwdt_set_heartbeat(timeout)) { advwdt_set_heartbeat(WATCHDOG_TIMEOUT); - printk(KERN_INFO PFX - "timeout value must be 1<=x<=63, using %d\n", timeout); + pr_info("timeout value must be 1<=x<=63, using %d\n", timeout); } ret = misc_register(&advwdt_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 unreg_regions; } - printk(KERN_INFO PFX "initialized. timeout=%d sec (nowayout=%d)\n", + pr_info("initialized. timeout=%d sec (nowayout=%d)\n", timeout, nowayout); out: return ret; @@ -318,8 +313,7 @@ static int __init advwdt_init(void) { int err; - printk(KERN_INFO - "WDT driver for Advantech single board computer initialising.\n"); + pr_info("WDT driver for Advantech single board computer initialising\n"); err = platform_driver_register(&advwdt_driver); if (err) @@ -343,7 +337,7 @@ static void __exit advwdt_exit(void) { platform_device_unregister(advwdt_platform_device); platform_driver_unregister(&advwdt_driver); - printk(KERN_INFO PFX "Watchdog Module Unloaded.\n"); + pr_info("Watchdog Module Unloaded\n"); } module_init(advwdt_init); diff --git a/drivers/watchdog/alim1535_wdt.c b/drivers/watchdog/alim1535_wdt.c index f16dcbd475f..e802f5e0241 100644 --- a/drivers/watchdog/alim1535_wdt.c +++ b/drivers/watchdog/alim1535_wdt.c @@ -7,6 +7,8 @@ * 2 of the License, or (at your option) any later version. */ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/types.h> @@ -22,7 +24,6 @@ #include <linux/io.h> #define WATCHDOG_NAME "ALi_M1535" -#define PFX WATCHDOG_NAME ": " #define WATCHDOG_TIMEOUT 60 /* 60 sec default timeout */ /* internal variables */ @@ -268,8 +269,7 @@ static int ali_release(struct inode *inode, struct file *file) if (ali_expect_release == 42) ali_stop(); else { - printk(KERN_CRIT PFX - "Unexpected close, not stopping watchdog!\n"); + pr_crit("Unexpected close, not stopping watchdog!\n"); ali_keepalive(); } clear_bit(0, &ali_is_open); @@ -399,9 +399,8 @@ static int __init watchdog_init(void) if not reset to the default */ if (timeout < 1 || timeout >= 18000) { timeout = WATCHDOG_TIMEOUT; - printk(KERN_INFO PFX - "timeout value must be 0 < timeout < 18000, using %d\n", - timeout); + pr_info("timeout value must be 0 < timeout < 18000, using %d\n", + timeout); } /* Calculate the watchdog's timeout */ @@ -409,20 +408,18 @@ static int __init watchdog_init(void) ret = register_reboot_notifier(&ali_notifier); if (ret != 0) { - printk(KERN_ERR PFX - "cannot register reboot notifier (err=%d)\n", ret); + pr_err("cannot register reboot notifier (err=%d)\n", ret); goto out; } ret = misc_register(&ali_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 unreg_reboot; } - printk(KERN_INFO PFX "initialized. timeout=%d sec (nowayout=%d)\n", + pr_info("initialized. timeout=%d sec (nowayout=%d)\n", timeout, nowayout); out: diff --git a/drivers/watchdog/alim7101_wdt.c b/drivers/watchdog/alim7101_wdt.c index 46f4b85b46d..e90f4ce3279 100644 --- a/drivers/watchdog/alim7101_wdt.c +++ b/drivers/watchdog/alim7101_wdt.c @@ -19,6 +19,8 @@ * -- Mike Waychison <michael.waychison@sun.com> */ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/types.h> @@ -36,9 +38,6 @@ #include <asm/system.h> -#define OUR_NAME "alim7101_wdt" -#define PFX OUR_NAME ": " - #define WDT_ENABLE 0x9C #define WDT_DISABLE 0x8C @@ -112,8 +111,7 @@ static void wdt_timer_ping(unsigned long data) ALI_7101_GPIO_O, tmp & ~0x20); } } else { - printk(KERN_WARNING PFX - "Heartbeat lost! Will not ping the watchdog\n"); + pr_warn("Heartbeat lost! Will not ping the watchdog\n"); } /* Re-set the timer interval */ mod_timer(&timer, jiffies + WDT_INTERVAL); @@ -162,7 +160,7 @@ static void wdt_startup(void) /* Start the timer */ mod_timer(&timer, jiffies + WDT_INTERVAL); - printk(KERN_INFO PFX "Watchdog timer is now enabled.\n"); + pr_info("Watchdog timer is now enabled\n"); } static void wdt_turnoff(void) @@ -170,7 +168,7 @@ static void wdt_turnoff(void) /* Stop the timer */ del_timer_sync(&timer); wdt_change(WDT_DISABLE); - printk(KERN_INFO PFX "Watchdog timer is now disabled...\n"); + pr_info("Watchdog timer is now disabled...\n"); } static void wdt_keepalive(void) @@ -226,8 +224,7 @@ static int fop_close(struct inode *inode, struct file *file) wdt_turnoff(); else { /* wim: shouldn't there be a: del_timer(&timer); */ - printk(KERN_CRIT PFX - "device file closed unexpectedly. Will not stop the WDT!\n"); + pr_crit("device file closed unexpectedly. Will not stop the WDT!\n"); } clear_bit(0, &wdt_is_open); wdt_expect_close = 0; @@ -322,8 +319,7 @@ static int wdt_notify_sys(struct notifier_block *this, * watchdog on reboot with no heartbeat */ wdt_change(WDT_ENABLE); - printk(KERN_INFO PFX "Watchdog timer is now enabled " - "with no heartbeat - should reboot in ~1 second.\n"); + pr_info("Watchdog timer is now enabled with no heartbeat - should reboot in ~1 second\n"); } return NOTIFY_DONE; } @@ -352,12 +348,11 @@ static int __init alim7101_wdt_init(void) struct pci_dev *ali1543_south; char tmp; - printk(KERN_INFO PFX "Steve Hill <steve@navaho.co.uk>.\n"); + pr_info("Steve Hill <steve@navaho.co.uk>\n"); alim7101_pmu = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101, NULL); if (!alim7101_pmu) { - printk(KERN_INFO PFX - "ALi M7101 PMU not present - WDT not set\n"); + pr_info("ALi M7101 PMU not present - WDT not set\n"); return -EBUSY; } @@ -367,56 +362,46 @@ static int __init alim7101_wdt_init(void) ali1543_south = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, NULL); if (!ali1543_south) { - printk(KERN_INFO PFX - "ALi 1543 South-Bridge not present - WDT not set\n"); + pr_info("ALi 1543 South-Bridge not present - WDT not set\n"); goto err_out; } pci_read_config_byte(ali1543_south, 0x5e, &tmp); pci_dev_put(ali1543_south); if ((tmp & 0x1e) == 0x00) { if (!use_gpio) { - printk(KERN_INFO PFX - "Detected old alim7101 revision 'a1d'. " - "If this is a cobalt board, set the 'use_gpio' " - "module parameter.\n"); + pr_info("Detected old alim7101 revision 'a1d'. If this is a cobalt board, set the 'use_gpio' module parameter.\n"); goto err_out; } nowayout = 1; } else if ((tmp & 0x1e) != 0x12 && (tmp & 0x1e) != 0x00) { - printk(KERN_INFO PFX - "ALi 1543 South-Bridge does not have the correct " - "revision number (???1001?) - WDT not set\n"); + pr_info("ALi 1543 South-Bridge does not have the correct revision number (???1001?) - WDT not set\n"); |