aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog/wdt977.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/wdt977.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/wdt977.c')
-rw-r--r--drivers/watchdog/wdt977.c36
1 files changed, 15 insertions, 21 deletions
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 @@
23 * Netwinders only 23 * Netwinders only
24 */ 24 */
25 25
26#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
27
26#include <linux/module.h> 28#include <linux/module.h>
27#include <linux/moduleparam.h> 29#include <linux/moduleparam.h>
28#include <linux/types.h> 30#include <linux/types.h>
@@ -42,8 +44,6 @@
42 44
43#define WATCHDOG_VERSION "0.04" 45#define WATCHDOG_VERSION "0.04"
44#define WATCHDOG_NAME "Wdt977" 46#define WATCHDOG_NAME "Wdt977"
45#define PFX WATCHDOG_NAME ": "
46#define DRIVER_VERSION WATCHDOG_NAME " driver, v" WATCHDOG_VERSION "\n"
47 47
48#define IO_INDEX_PORT 0x370 /* on some systems it can be 0x3F0 */ 48#define IO_INDEX_PORT 0x370 /* on some systems it can be 0x3F0 */
49#define IO_DATA_PORT (IO_INDEX_PORT + 1) 49#define IO_DATA_PORT (IO_INDEX_PORT + 1)
@@ -119,7 +119,7 @@ static int wdt977_start(void)
119 outb_p(LOCK_DATA, IO_INDEX_PORT); 119 outb_p(LOCK_DATA, IO_INDEX_PORT);
120 120
121 spin_unlock_irqrestore(&spinlock, flags); 121 spin_unlock_irqrestore(&spinlock, flags);
122 printk(KERN_INFO PFX "activated.\n"); 122 pr_info("activated\n");
123 123
124 return 0; 124 return 0;
125} 125}
@@ -164,7 +164,7 @@ static int wdt977_stop(void)
164 outb_p(LOCK_DATA, IO_INDEX_PORT); 164 outb_p(LOCK_DATA, IO_INDEX_PORT);
165 165
166 spin_unlock_irqrestore(&spinlock, flags); 166 spin_unlock_irqrestore(&spinlock, flags);
167 printk(KERN_INFO PFX "shutdown.\n"); 167 pr_info("shutdown\n");
168 168
169 return 0; 169 return 0;
170} 170}
@@ -288,8 +288,7 @@ static int wdt977_release(struct inode *inode, struct file *file)
288 clear_bit(0, &timer_alive); 288 clear_bit(0, &timer_alive);
289 } else { 289 } else {
290 wdt977_keepalive(); 290 wdt977_keepalive();
291 printk(KERN_CRIT PFX 291 pr_crit("Unexpected close, not stopping watchdog!\n");
292 "Unexpected close, not stopping watchdog!\n");
293 } 292 }
294 expect_close = 0; 293 expect_close = 0;
295 return 0; 294 return 0;
@@ -446,15 +445,14 @@ static int __init wd977_init(void)
446{ 445{
447 int rc; 446 int rc;
448 447
449 printk(KERN_INFO PFX DRIVER_VERSION); 448 pr_info("driver v%s\n", WATCHDOG_VERSION);
450 449
451 /* Check that the timeout value is within its range; 450 /* Check that the timeout value is within its range;
452 if not reset to the default */ 451 if not reset to the default */
453 if (wdt977_set_timeout(timeout)) { 452 if (wdt977_set_timeout(timeout)) {
454 wdt977_set_timeout(DEFAULT_TIMEOUT); 453 wdt977_set_timeout(DEFAULT_TIMEOUT);
455 printk(KERN_INFO PFX 454 pr_info("timeout value must be 60 < timeout < 15300, using %d\n",
456 "timeout value must be 60 < timeout < 15300, using %d\n", 455 DEFAULT_TIMEOUT);
457 DEFAULT_TIMEOUT);
458 } 456 }
459 457
460 /* on Netwinder the IOports are already reserved by 458 /* on Netwinder the IOports are already reserved by
@@ -462,9 +460,8 @@ static int __init wd977_init(void)
462 */ 460 */
463 if (!machine_is_netwinder()) { 461 if (!machine_is_netwinder()) {
464 if (!request_region(IO_INDEX_PORT, 2, WATCHDOG_NAME)) { 462 if (!request_region(IO_INDEX_PORT, 2, WATCHDOG_NAME)) {
465 printk(KERN_ERR PFX 463 pr_err("I/O address 0x%04x already in use\n",
466 "I/O address 0x%04x already in use\n", 464 IO_INDEX_PORT);
467 IO_INDEX_PORT);
468 rc = -EIO; 465 rc = -EIO;
469 goto err_out; 466 goto err_out;
470 } 467 }
@@ -472,22 +469,19 @@ static int __init wd977_init(void)
472 469
473 rc = register_reboot_notifier(&wdt977_notifier); 470 rc = register_reboot_notifier(&wdt977_notifier);
474 if (rc) { 471 if (rc) {
475 printk(KERN_ERR PFX 472 pr_err("cannot register reboot notifier (err=%d)\n", rc);
476 "cannot register reboot notifier (err=%d)\n", rc);
477 goto err_out_region; 473 goto err_out_region;
478 } 474 }
479 475
480 rc = misc_register(&wdt977_miscdev); 476 rc = misc_register(&wdt977_miscdev);
481 if (rc) { 477 if (rc) {
482 printk(KERN_ERR PFX 478 pr_err("cannot register miscdev on minor=%d (err=%d)\n",
483 "cannot register miscdev on minor=%d (err=%d)\n", 479 wdt977_miscdev.minor, rc);
484 wdt977_miscdev.minor, rc);
485 goto err_out_reboot; 480 goto err_out_reboot;
486 } 481 }
487 482
488 printk(KERN_INFO PFX 483 pr_info("initialized. timeout=%d sec (nowayout=%d, testmode=%i)\n",
489 "initialized. timeout=%d sec (nowayout=%d, testmode=%i)\n", 484 timeout, nowayout, testmode);
490 timeout, nowayout, testmode);
491 485
492 return 0; 486 return 0;
493 487