aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog/w83877f_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/w83877f_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/w83877f_wdt.c')
-rw-r--r--drivers/watchdog/w83877f_wdt.c36
1 files changed, 15 insertions, 21 deletions
diff --git a/drivers/watchdog/w83877f_wdt.c b/drivers/watchdog/w83877f_wdt.c
index 24587d2060c4..d761414de809 100644
--- a/drivers/watchdog/w83877f_wdt.c
+++ b/drivers/watchdog/w83877f_wdt.c
@@ -42,6 +42,8 @@
42 * daemon always getting scheduled within that time frame. 42 * daemon always getting scheduled within that time frame.
43 */ 43 */
44 44
45#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
46
45#include <linux/module.h> 47#include <linux/module.h>
46#include <linux/moduleparam.h> 48#include <linux/moduleparam.h>
47#include <linux/types.h> 49#include <linux/types.h>
@@ -59,7 +61,6 @@
59#include <asm/system.h> 61#include <asm/system.h>
60 62
61#define OUR_NAME "w83877f_wdt" 63#define OUR_NAME "w83877f_wdt"
62#define PFX OUR_NAME ": "
63 64
64#define ENABLE_W83877F_PORT 0x3F0 65#define ENABLE_W83877F_PORT 0x3F0
65#define ENABLE_W83877F 0x87 66#define ENABLE_W83877F 0x87
@@ -126,8 +127,7 @@ static void wdt_timer_ping(unsigned long data)
126 spin_unlock(&wdt_spinlock); 127 spin_unlock(&wdt_spinlock);
127 128
128 } else 129 } else
129 printk(KERN_WARNING PFX 130 pr_warn("Heartbeat lost! Will not ping the watchdog\n");
130 "Heartbeat lost! Will not ping the watchdog\n");
131} 131}
132 132
133/* 133/*
@@ -165,7 +165,7 @@ static void wdt_startup(void)
165 165
166 wdt_change(WDT_ENABLE); 166 wdt_change(WDT_ENABLE);
167 167
168 printk(KERN_INFO PFX "Watchdog timer is now enabled.\n"); 168 pr_info("Watchdog timer is now enabled\n");
169} 169}
170 170
171static void wdt_turnoff(void) 171static void wdt_turnoff(void)
@@ -175,7 +175,7 @@ static void wdt_turnoff(void)
175 175
176 wdt_change(WDT_DISABLE); 176 wdt_change(WDT_DISABLE);
177 177
178 printk(KERN_INFO PFX "Watchdog timer is now disabled...\n"); 178 pr_info("Watchdog timer is now disabled...\n");
179} 179}
180 180
181static void wdt_keepalive(void) 181static void wdt_keepalive(void)
@@ -234,8 +234,7 @@ static int fop_close(struct inode *inode, struct file *file)
234 wdt_turnoff(); 234 wdt_turnoff();
235 else { 235 else {
236 del_timer(&timer); 236 del_timer(&timer);
237 printk(KERN_CRIT PFX 237 pr_crit("device file closed unexpectedly. Will not stop the WDT!\n");
238 "device file closed unexpectedly. Will not stop the WDT!\n");
239 } 238 }
240 clear_bit(0, &wdt_is_open); 239 clear_bit(0, &wdt_is_open);
241 wdt_expect_close = 0; 240 wdt_expect_close = 0;
@@ -357,42 +356,37 @@ static int __init w83877f_wdt_init(void)
357 356
358 if (timeout < 1 || timeout > 3600) { /* arbitrary upper limit */ 357 if (timeout < 1 || timeout > 3600) { /* arbitrary upper limit */
359 timeout = WATCHDOG_TIMEOUT; 358 timeout = WATCHDOG_TIMEOUT;
360 printk(KERN_INFO PFX 359 pr_info("timeout value must be 1 <= x <= 3600, using %d\n",
361 "timeout value must be 1 <= x <= 3600, using %d\n", 360 timeout);
362 timeout);
363 } 361 }
364 362
365 if (!request_region(ENABLE_W83877F_PORT, 2, "W83877F WDT")) { 363 if (!request_region(ENABLE_W83877F_PORT, 2, "W83877F WDT")) {
366 printk(KERN_ERR PFX "I/O address 0x%04x already in use\n", 364 pr_err("I/O address 0x%04x already in use\n",
367 ENABLE_W83877F_PORT); 365 ENABLE_W83877F_PORT);
368 rc = -EIO; 366 rc = -EIO;
369 goto err_out; 367 goto err_out;
370 } 368 }
371 369
372 if (!request_region(WDT_PING, 1, "W8387FF WDT")) { 370 if (!request_region(WDT_PING, 1, "W8387FF WDT")) {
373 printk(KERN_ERR PFX "I/O address 0x%04x already in use\n", 371 pr_err("I/O address 0x%04x already in use\n", WDT_PING);
374 WDT_PING);
375 rc = -EIO; 372 rc = -EIO;
376 goto err_out_region1; 373 goto err_out_region1;
377 } 374 }
378 375
379 rc = register_reboot_notifier(&wdt_notifier); 376 rc = register_reboot_notifier(&wdt_notifier);
380 if (rc) { 377 if (rc) {
381 printk(KERN_ERR PFX 378 pr_err("cannot register reboot notifier (err=%d)\n", rc);
382 "cannot register reboot notifier (err=%d)\n", rc);
383 goto err_out_region2; 379 goto err_out_region2;
384 } 380 }
385 381
386 rc = misc_register(&wdt_miscdev); 382 rc = misc_register(&wdt_miscdev);
387 if (rc) { 383 if (rc) {
388 printk(KERN_ERR PFX 384 pr_err("cannot register miscdev on minor=%d (err=%d)\n",
389 "cannot register miscdev on minor=%d (err=%d)\n", 385 wdt_miscdev.minor, rc);
390 wdt_miscdev.minor, rc);
391 goto err_out_reboot; 386 goto err_out_reboot;
392 } 387 }
393 388
394 printk(KERN_INFO PFX 389 pr_info("WDT driver for W83877F initialised. timeout=%d sec (nowayout=%d)\n",
395 "WDT driver for W83877F initialised. timeout=%d sec (nowayout=%d)\n",
396 timeout, nowayout); 390 timeout, nowayout);
397 391
398 return 0; 392 return 0;