aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog/scx200_wdt.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2012-02-15 18:06:19 -0500
committerWim Van Sebroeck <wim@iguana.be>2012-03-27 13:59:26 -0400
commit27c766aaacb265d625dc634bf7903f7f9fd0c697 (patch)
tree06b399d21dec006bc0a3e1c6685b076753e19b94 /drivers/watchdog/scx200_wdt.c
parent7cbc353540c31ffaf65ad44d89b955be0f1d04dc (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/scx200_wdt.c')
-rw-r--r--drivers/watchdog/scx200_wdt.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/watchdog/scx200_wdt.c b/drivers/watchdog/scx200_wdt.c
index e67b76c0526c..35ada2e90664 100644
--- a/drivers/watchdog/scx200_wdt.c
+++ b/drivers/watchdog/scx200_wdt.c
@@ -17,6 +17,8 @@
17 of any nature resulting due to the use of this software. This 17 of any nature resulting due to the use of this software. This
18 software is provided AS-IS with no warranties. */ 18 software is provided AS-IS with no warranties. */
19 19
20#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
21
20#include <linux/module.h> 22#include <linux/module.h>
21#include <linux/moduleparam.h> 23#include <linux/moduleparam.h>
22#include <linux/init.h> 24#include <linux/init.h>
@@ -30,7 +32,7 @@
30#include <linux/uaccess.h> 32#include <linux/uaccess.h>
31#include <linux/io.h> 33#include <linux/io.h>
32 34
33#define NAME "scx200_wdt" 35#define DEBUG
34 36
35MODULE_AUTHOR("Christer Weinigel <wingel@nano-system.com>"); 37MODULE_AUTHOR("Christer Weinigel <wingel@nano-system.com>");
36MODULE_DESCRIPTION("NatSemi SCx200 Watchdog Driver"); 38MODULE_DESCRIPTION("NatSemi SCx200 Watchdog Driver");
@@ -66,14 +68,13 @@ static void scx200_wdt_ping(void)
66 68
67static void scx200_wdt_update_margin(void) 69static void scx200_wdt_update_margin(void)
68{ 70{
69 printk(KERN_INFO NAME ": timer margin %d seconds\n", margin); 71 pr_info("timer margin %d seconds\n", margin);
70 wdto_restart = margin * W_SCALE; 72 wdto_restart = margin * W_SCALE;
71} 73}
72 74
73static void scx200_wdt_enable(void) 75static void scx200_wdt_enable(void)
74{ 76{
75 printk(KERN_DEBUG NAME ": enabling watchdog timer, wdto_restart = %d\n", 77 pr_debug("enabling watchdog timer, wdto_restart = %d\n", wdto_restart);
76 wdto_restart);
77 78
78 spin_lock(&scx_lock); 79 spin_lock(&scx_lock);
79 outw(0, scx200_cb_base + SCx200_WDT_WDTO); 80 outw(0, scx200_cb_base + SCx200_WDT_WDTO);
@@ -86,7 +87,7 @@ static void scx200_wdt_enable(void)
86 87
87static void scx200_wdt_disable(void) 88static void scx200_wdt_disable(void)
88{ 89{
89 printk(KERN_DEBUG NAME ": disabling watchdog timer\n"); 90 pr_debug("disabling watchdog timer\n");
90 91
91 spin_lock(&scx_lock); 92 spin_lock(&scx_lock);
92 outw(0, scx200_cb_base + SCx200_WDT_WDTO); 93 outw(0, scx200_cb_base + SCx200_WDT_WDTO);
@@ -108,9 +109,7 @@ static int scx200_wdt_open(struct inode *inode, struct file *file)
108static int scx200_wdt_release(struct inode *inode, struct file *file) 109static int scx200_wdt_release(struct inode *inode, struct file *file)
109{ 110{
110 if (expect_close != 42) 111 if (expect_close != 42)
111 printk(KERN_WARNING NAME 112 pr_warn("watchdog device closed unexpectedly, will not disable the watchdog timer\n");
112 ": watchdog device closed unexpectedly, "
113 "will not disable the watchdog timer\n");
114 else if (!nowayout) 113 else if (!nowayout)
115 scx200_wdt_disable(); 114 scx200_wdt_disable();
116 expect_close = 0; 115 expect_close = 0;
@@ -219,7 +218,7 @@ static int __init scx200_wdt_init(void)
219{ 218{
220 int r; 219 int r;
221 220
222 printk(KERN_DEBUG NAME ": NatSemi SCx200 Watchdog Driver\n"); 221 pr_debug("NatSemi SCx200 Watchdog Driver\n");
223 222
224 /* check that we have found the configuration block */ 223 /* check that we have found the configuration block */
225 if (!scx200_cb_present()) 224 if (!scx200_cb_present())
@@ -228,7 +227,7 @@ static int __init scx200_wdt_init(void)
228 if (!request_region(scx200_cb_base + SCx200_WDT_OFFSET, 227 if (!request_region(scx200_cb_base + SCx200_WDT_OFFSET,
229 SCx200_WDT_SIZE, 228 SCx200_WDT_SIZE,
230 "NatSemi SCx200 Watchdog")) { 229 "NatSemi SCx200 Watchdog")) {
231 printk(KERN_WARNING NAME ": watchdog I/O region busy\n"); 230 pr_warn("watchdog I/O region busy\n");
232 return -EBUSY; 231 return -EBUSY;
233 } 232 }
234 233
@@ -237,7 +236,7 @@ static int __init scx200_wdt_init(void)
237 236
238 r = register_reboot_notifier(&scx200_wdt_notifier); 237 r = register_reboot_notifier(&scx200_wdt_notifier);
239 if (r) { 238 if (r) {
240 printk(KERN_ERR NAME ": unable to register reboot notifier"); 239 pr_err("unable to register reboot notifier\n");
241 release_region(scx200_cb_base + SCx200_WDT_OFFSET, 240 release_region(scx200_cb_base + SCx200_WDT_OFFSET,
242 SCx200_WDT_SIZE); 241 SCx200_WDT_SIZE);
243 return r; 242 return r;