diff options
Diffstat (limited to 'drivers/watchdog/w83977f_wdt.c')
-rw-r--r-- | drivers/watchdog/w83977f_wdt.c | 38 |
1 files changed, 16 insertions, 22 deletions
diff --git a/drivers/watchdog/w83977f_wdt.c b/drivers/watchdog/w83977f_wdt.c index 7f4330ea5ae..5d2c902825c 100644 --- a/drivers/watchdog/w83977f_wdt.c +++ b/drivers/watchdog/w83977f_wdt.c | |||
@@ -15,6 +15,8 @@ | |||
15 | * | 15 | * |
16 | */ | 16 | */ |
17 | 17 | ||
18 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
19 | |||
18 | #include <linux/module.h> | 20 | #include <linux/module.h> |
19 | #include <linux/moduleparam.h> | 21 | #include <linux/moduleparam.h> |
20 | #include <linux/types.h> | 22 | #include <linux/types.h> |
@@ -32,8 +34,6 @@ | |||
32 | 34 | ||
33 | #define WATCHDOG_VERSION "1.00" | 35 | #define WATCHDOG_VERSION "1.00" |
34 | #define WATCHDOG_NAME "W83977F WDT" | 36 | #define WATCHDOG_NAME "W83977F WDT" |
35 | #define PFX WATCHDOG_NAME ": " | ||
36 | #define DRIVER_VERSION WATCHDOG_NAME " driver, v" WATCHDOG_VERSION "\n" | ||
37 | 37 | ||
38 | #define IO_INDEX_PORT 0x3F0 | 38 | #define IO_INDEX_PORT 0x3F0 |
39 | #define IO_DATA_PORT (IO_INDEX_PORT+1) | 39 | #define IO_DATA_PORT (IO_INDEX_PORT+1) |
@@ -58,8 +58,8 @@ MODULE_PARM_DESC(timeout, | |||
58 | module_param(testmode, int, 0); | 58 | module_param(testmode, int, 0); |
59 | MODULE_PARM_DESC(testmode, "Watchdog testmode (1 = no reboot), default=0"); | 59 | MODULE_PARM_DESC(testmode, "Watchdog testmode (1 = no reboot), default=0"); |
60 | 60 | ||
61 | static int nowayout = WATCHDOG_NOWAYOUT; | 61 | static bool nowayout = WATCHDOG_NOWAYOUT; |
62 | module_param(nowayout, int, 0); | 62 | module_param(nowayout, bool, 0); |
63 | MODULE_PARM_DESC(nowayout, | 63 | MODULE_PARM_DESC(nowayout, |
64 | "Watchdog cannot be stopped once started (default=" | 64 | "Watchdog cannot be stopped once started (default=" |
65 | __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); | 65 | __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); |
@@ -130,7 +130,7 @@ static int wdt_start(void) | |||
130 | 130 | ||
131 | spin_unlock_irqrestore(&spinlock, flags); | 131 | spin_unlock_irqrestore(&spinlock, flags); |
132 | 132 | ||
133 | printk(KERN_INFO PFX "activated.\n"); | 133 | pr_info("activated\n"); |
134 | 134 | ||
135 | return 0; | 135 | return 0; |
136 | } | 136 | } |
@@ -184,7 +184,7 @@ static int wdt_stop(void) | |||
184 | 184 | ||
185 | spin_unlock_irqrestore(&spinlock, flags); | 185 | spin_unlock_irqrestore(&spinlock, flags); |
186 | 186 | ||
187 | printk(KERN_INFO PFX "shutdown.\n"); | 187 | pr_info("shutdown\n"); |
188 | 188 | ||
189 | return 0; | 189 | return 0; |
190 | } | 190 | } |
@@ -312,8 +312,7 @@ static int wdt_release(struct inode *inode, struct file *file) | |||
312 | clear_bit(0, &timer_alive); | 312 | clear_bit(0, &timer_alive); |
313 | } else { | 313 | } else { |
314 | wdt_keepalive(); | 314 | wdt_keepalive(); |
315 | printk(KERN_CRIT PFX | 315 | pr_crit("unexpected close, not stopping watchdog!\n"); |
316 | "unexpected close, not stopping watchdog!\n"); | ||
317 | } | 316 | } |
318 | expect_close = 0; | 317 | expect_close = 0; |
319 | return 0; | 318 | return 0; |
@@ -470,7 +469,7 @@ static int __init w83977f_wdt_init(void) | |||
470 | { | 469 | { |
471 | int rc; | 470 | int rc; |
472 | 471 | ||
473 | printk(KERN_INFO PFX DRIVER_VERSION); | 472 | pr_info("driver v%s\n", WATCHDOG_VERSION); |
474 | 473 | ||
475 | /* | 474 | /* |
476 | * Check that the timeout value is within it's range; | 475 | * Check that the timeout value is within it's range; |
@@ -478,36 +477,31 @@ static int __init w83977f_wdt_init(void) | |||
478 | */ | 477 | */ |
479 | if (wdt_set_timeout(timeout)) { | 478 | if (wdt_set_timeout(timeout)) { |
480 | wdt_set_timeout(DEFAULT_TIMEOUT); | 479 | wdt_set_timeout(DEFAULT_TIMEOUT); |
481 | printk(KERN_INFO PFX | 480 | pr_info("timeout value must be 15 <= timeout <= 7635, using %d\n", |
482 | "timeout value must be 15 <= timeout <= 7635, using %d\n", | 481 | DEFAULT_TIMEOUT); |
483 | DEFAULT_TIMEOUT); | ||
484 | } | 482 | } |
485 | 483 | ||
486 | if (!request_region(IO_INDEX_PORT, 2, WATCHDOG_NAME)) { | 484 | if (!request_region(IO_INDEX_PORT, 2, WATCHDOG_NAME)) { |
487 | printk(KERN_ERR PFX "I/O address 0x%04x already in use\n", | 485 | pr_err("I/O address 0x%04x already in use\n", IO_INDEX_PORT); |
488 | IO_INDEX_PORT); | ||
489 | rc = -EIO; | 486 | rc = -EIO; |
490 | goto err_out; | 487 | goto err_out; |
491 | } | 488 | } |
492 | 489 | ||
493 | rc = register_reboot_notifier(&wdt_notifier); | 490 | rc = register_reboot_notifier(&wdt_notifier); |
494 | if (rc) { | 491 | if (rc) { |
495 | printk(KERN_ERR PFX | 492 | pr_err("cannot register reboot notifier (err=%d)\n", rc); |
496 | "cannot register reboot notifier (err=%d)\n", rc); | ||
497 | goto err_out_region; | 493 | goto err_out_region; |
498 | } | 494 | } |
499 | 495 | ||
500 | rc = misc_register(&wdt_miscdev); | 496 | rc = misc_register(&wdt_miscdev); |
501 | if (rc) { | 497 | if (rc) { |
502 | printk(KERN_ERR PFX | 498 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
503 | "cannot register miscdev on minor=%d (err=%d)\n", | 499 | wdt_miscdev.minor, rc); |
504 | wdt_miscdev.minor, rc); | ||
505 | goto err_out_reboot; | 500 | goto err_out_reboot; |
506 | } | 501 | } |
507 | 502 | ||
508 | printk(KERN_INFO PFX | 503 | pr_info("initialized. timeout=%d sec (nowayout=%d testmode=%d)\n", |
509 | "initialized. timeout=%d sec (nowayout=%d testmode=%d)\n", | 504 | timeout, nowayout, testmode); |
510 | timeout, nowayout, testmode); | ||
511 | 505 | ||
512 | return 0; | 506 | return 0; |
513 | 507 | ||