aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog/sc1200wdt.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/sc1200wdt.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/sc1200wdt.c')
-rw-r--r--drivers/watchdog/sc1200wdt.c30
1 files changed, 13 insertions, 17 deletions
diff --git a/drivers/watchdog/sc1200wdt.c b/drivers/watchdog/sc1200wdt.c
index c01daca8405a..0698b3d794ea 100644
--- a/drivers/watchdog/sc1200wdt.c
+++ b/drivers/watchdog/sc1200wdt.c
@@ -31,6 +31,8 @@
31 * 31 *
32 */ 32 */
33 33
34#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
35
34#include <linux/module.h> 36#include <linux/module.h>
35#include <linux/moduleparam.h> 37#include <linux/moduleparam.h>
36#include <linux/miscdevice.h> 38#include <linux/miscdevice.h>
@@ -48,7 +50,6 @@
48 50
49#define SC1200_MODULE_VER "build 20020303" 51#define SC1200_MODULE_VER "build 20020303"
50#define SC1200_MODULE_NAME "sc1200wdt" 52#define SC1200_MODULE_NAME "sc1200wdt"
51#define PFX SC1200_MODULE_NAME ": "
52 53
53#define MAX_TIMEOUT 255 /* 255 minutes */ 54#define MAX_TIMEOUT 255 /* 255 minutes */
54#define PMIR (io) /* Power Management Index Register */ 55#define PMIR (io) /* Power Management Index Register */
@@ -71,7 +72,6 @@
71#define UART2_IRQ 0x04 /* Serial1 */ 72#define UART2_IRQ 0x04 /* Serial1 */
72/* 5 -7 are reserved */ 73/* 5 -7 are reserved */
73 74
74static char banner[] __initdata = PFX SC1200_MODULE_VER;
75static int timeout = 1; 75static int timeout = 1;
76static int io = -1; 76static int io = -1;
77static int io_len = 2; /* for non plug and play */ 77static int io_len = 2; /* for non plug and play */
@@ -176,7 +176,7 @@ static int sc1200wdt_open(struct inode *inode, struct file *file)
176 timeout = MAX_TIMEOUT; 176 timeout = MAX_TIMEOUT;
177 177
178 sc1200wdt_start(); 178 sc1200wdt_start();
179 printk(KERN_INFO PFX "Watchdog enabled, timeout = %d min(s)", timeout); 179 pr_info("Watchdog enabled, timeout = %d min(s)", timeout);
180 180
181 return nonseekable_open(inode, file); 181 return nonseekable_open(inode, file);
182} 182}
@@ -254,11 +254,10 @@ static int sc1200wdt_release(struct inode *inode, struct file *file)
254{ 254{
255 if (expect_close == 42) { 255 if (expect_close == 42) {
256 sc1200wdt_stop(); 256 sc1200wdt_stop();
257 printk(KERN_INFO PFX "Watchdog disabled\n"); 257 pr_info("Watchdog disabled\n");
258 } else { 258 } else {
259 sc1200wdt_write_data(WDTO, timeout); 259 sc1200wdt_write_data(WDTO, timeout);
260 printk(KERN_CRIT PFX 260 pr_crit("Unexpected close!, timeout = %d min(s)\n", timeout);
261 "Unexpected close!, timeout = %d min(s)\n", timeout);
262 } 261 }
263 clear_bit(0, &open_flag); 262 clear_bit(0, &open_flag);
264 expect_close = 0; 263 expect_close = 0;
@@ -361,12 +360,11 @@ static int scl200wdt_pnp_probe(struct pnp_dev *dev,
361 io_len = pnp_port_len(wdt_dev, 0); 360 io_len = pnp_port_len(wdt_dev, 0);
362 361
363 if (!request_region(io, io_len, SC1200_MODULE_NAME)) { 362 if (!request_region(io, io_len, SC1200_MODULE_NAME)) {
364 printk(KERN_ERR PFX "Unable to register IO port %#x\n", io); 363 pr_err("Unable to register IO port %#x\n", io);
365 return -EBUSY; 364 return -EBUSY;
366 } 365 }
367 366
368 printk(KERN_INFO "scl200wdt: PnP device found at io port %#x/%d\n", 367 pr_info("PnP device found at io port %#x/%d\n", io, io_len);
369 io, io_len);
370 return 0; 368 return 0;
371} 369}
372 370
@@ -392,7 +390,7 @@ static int __init sc1200wdt_init(void)
392{ 390{
393 int ret; 391 int ret;
394 392
395 printk(KERN_INFO "%s\n", banner); 393 pr_info("%s\n", SC1200_MODULE_VER);
396 394
397#if defined CONFIG_PNP 395#if defined CONFIG_PNP
398 if (isapnp) { 396 if (isapnp) {
@@ -403,7 +401,7 @@ static int __init sc1200wdt_init(void)
403#endif 401#endif
404 402
405 if (io == -1) { 403 if (io == -1) {
406 printk(KERN_ERR PFX "io parameter must be specified\n"); 404 pr_err("io parameter must be specified\n");
407 ret = -EINVAL; 405 ret = -EINVAL;
408 goto out_pnp; 406 goto out_pnp;
409 } 407 }
@@ -416,7 +414,7 @@ static int __init sc1200wdt_init(void)
416#endif 414#endif
417 415
418 if (!request_region(io, io_len, SC1200_MODULE_NAME)) { 416 if (!request_region(io, io_len, SC1200_MODULE_NAME)) {
419 printk(KERN_ERR PFX "Unable to register IO port %#x\n", io); 417 pr_err("Unable to register IO port %#x\n", io);
420 ret = -EBUSY; 418 ret = -EBUSY;
421 goto out_pnp; 419 goto out_pnp;
422 } 420 }
@@ -427,16 +425,14 @@ static int __init sc1200wdt_init(void)
427 425
428 ret = register_reboot_notifier(&sc1200wdt_notifier); 426 ret = register_reboot_notifier(&sc1200wdt_notifier);
429 if (ret) { 427 if (ret) {
430 printk(KERN_ERR PFX 428 pr_err("Unable to register reboot notifier err = %d\n", ret);
431 "Unable to register reboot notifier err = %d\n", ret);
432 goto out_io; 429 goto out_io;
433 } 430 }
434 431
435 ret = misc_register(&sc1200wdt_miscdev); 432 ret = misc_register(&sc1200wdt_miscdev);
436 if (ret) { 433 if (ret) {
437 printk(KERN_ERR PFX 434 pr_err("Unable to register miscdev on minor %d\n",
438 "Unable to register miscdev on minor %d\n", 435 WATCHDOG_MINOR);
439 WATCHDOG_MINOR);
440 goto out_rbt; 436 goto out_rbt;
441 } 437 }
442 438