From 27c766aaacb265d625dc634bf7903f7f9fd0c697 Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Wed, 15 Feb 2012 15:06:19 -0800 Subject: watchdog: Use pr_ and pr_ 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 Signed-off-by: Wim Van Sebroeck --- drivers/watchdog/wdt977.c | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) (limited to 'drivers/watchdog/wdt977.c') diff --git a/drivers/watchdog/wdt977.c b/drivers/watchdog/wdt977.c index a2f01c9f5c34..cfb0a8cd7f12 100644 --- a/drivers/watchdog/wdt977.c +++ b/drivers/watchdog/wdt977.c @@ -23,6 +23,8 @@ * Netwinders only */ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + #include #include #include @@ -42,8 +44,6 @@ #define WATCHDOG_VERSION "0.04" #define WATCHDOG_NAME "Wdt977" -#define PFX WATCHDOG_NAME ": " -#define DRIVER_VERSION WATCHDOG_NAME " driver, v" WATCHDOG_VERSION "\n" #define IO_INDEX_PORT 0x370 /* on some systems it can be 0x3F0 */ #define IO_DATA_PORT (IO_INDEX_PORT + 1) @@ -119,7 +119,7 @@ static int wdt977_start(void) outb_p(LOCK_DATA, IO_INDEX_PORT); spin_unlock_irqrestore(&spinlock, flags); - printk(KERN_INFO PFX "activated.\n"); + pr_info("activated\n"); return 0; } @@ -164,7 +164,7 @@ static int wdt977_stop(void) outb_p(LOCK_DATA, IO_INDEX_PORT); spin_unlock_irqrestore(&spinlock, flags); - printk(KERN_INFO PFX "shutdown.\n"); + pr_info("shutdown\n"); return 0; } @@ -288,8 +288,7 @@ static int wdt977_release(struct inode *inode, struct file *file) clear_bit(0, &timer_alive); } else { wdt977_keepalive(); - printk(KERN_CRIT PFX - "Unexpected close, not stopping watchdog!\n"); + pr_crit("Unexpected close, not stopping watchdog!\n"); } expect_close = 0; return 0; @@ -446,15 +445,14 @@ static int __init wd977_init(void) { int rc; - printk(KERN_INFO PFX DRIVER_VERSION); + pr_info("driver v%s\n", WATCHDOG_VERSION); /* Check that the timeout value is within its range; if not reset to the default */ if (wdt977_set_timeout(timeout)) { wdt977_set_timeout(DEFAULT_TIMEOUT); - printk(KERN_INFO PFX - "timeout value must be 60 < timeout < 15300, using %d\n", - DEFAULT_TIMEOUT); + pr_info("timeout value must be 60 < timeout < 15300, using %d\n", + DEFAULT_TIMEOUT); } /* on Netwinder the IOports are already reserved by @@ -462,9 +460,8 @@ static int __init wd977_init(void) */ if (!machine_is_netwinder()) { if (!request_region(IO_INDEX_PORT, 2, WATCHDOG_NAME)) { - printk(KERN_ERR PFX - "I/O address 0x%04x already in use\n", - IO_INDEX_PORT); + pr_err("I/O address 0x%04x already in use\n", + IO_INDEX_PORT); rc = -EIO; goto err_out; } @@ -472,22 +469,19 @@ static int __init wd977_init(void) rc = register_reboot_notifier(&wdt977_notifier); if (rc) { - printk(KERN_ERR PFX - "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(&wdt977_miscdev); if (rc) { - printk(KERN_ERR PFX - "cannot register miscdev on minor=%d (err=%d)\n", - wdt977_miscdev.minor, rc); + pr_err("cannot register miscdev on minor=%d (err=%d)\n", + wdt977_miscdev.minor, rc); goto err_out_reboot; } - printk(KERN_INFO PFX - "initialized. timeout=%d sec (nowayout=%d, testmode=%i)\n", - timeout, nowayout, testmode); + pr_info("initialized. timeout=%d sec (nowayout=%d, testmode=%i)\n", + timeout, nowayout, testmode); return 0; -- cgit v1.2.1 From 86a1e1896c2710402e29a875d8d830244274244d Mon Sep 17 00:00:00 2001 From: Wim Van Sebroeck Date: Mon, 5 Mar 2012 16:51:11 +0100 Subject: watchdog: nowayout is bool nowayout is actually a boolean value. So make it bool for all watchdog device drivers. Signed-off-by: Wim Van Sebroeck --- drivers/watchdog/wdt977.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/watchdog/wdt977.c') diff --git a/drivers/watchdog/wdt977.c b/drivers/watchdog/wdt977.c index cfb0a8cd7f12..2de1632708a0 100644 --- a/drivers/watchdog/wdt977.c +++ b/drivers/watchdog/wdt977.c @@ -68,8 +68,8 @@ MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds (60..15300, default=" module_param(testmode, int, 0); MODULE_PARM_DESC(testmode, "Watchdog testmode (1 = no reboot), default=0"); -static int nowayout = WATCHDOG_NOWAYOUT; -module_param(nowayout, int, 0); +static bool nowayout = WATCHDOG_NOWAYOUT; +module_param(nowayout, bool, 0); MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); -- cgit v1.2.1 From 9ffc93f203c18a70623f21950f1dd473c9ec48cd Mon Sep 17 00:00:00 2001 From: David Howells Date: Wed, 28 Mar 2012 18:30:03 +0100 Subject: Remove all #inclusions of asm/system.h Remove all #inclusions of asm/system.h preparatory to splitting and killing it. Performed with the following command: perl -p -i -e 's!^#\s*include\s*.*\n!!' `grep -Irl '^#\s*include\s*' *` Signed-off-by: David Howells --- drivers/watchdog/wdt977.c | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/watchdog/wdt977.c') diff --git a/drivers/watchdog/wdt977.c b/drivers/watchdog/wdt977.c index a2f01c9f5c34..855bb0f0717d 100644 --- a/drivers/watchdog/wdt977.c +++ b/drivers/watchdog/wdt977.c @@ -37,7 +37,6 @@ #include #include -#include #include #define WATCHDOG_VERSION "0.04" -- cgit v1.2.1