diff options
Diffstat (limited to 'drivers/watchdog/w83697ug_wdt.c')
-rw-r--r-- | drivers/watchdog/w83697ug_wdt.c | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/drivers/watchdog/w83697ug_wdt.c b/drivers/watchdog/w83697ug_wdt.c index be9c4d839e15..025736bacf5f 100644 --- a/drivers/watchdog/w83697ug_wdt.c +++ b/drivers/watchdog/w83697ug_wdt.c | |||
@@ -30,6 +30,8 @@ | |||
30 | * (c) Copyright 1995 Alan Cox <alan@redhat.com> | 30 | * (c) Copyright 1995 Alan Cox <alan@redhat.com> |
31 | */ | 31 | */ |
32 | 32 | ||
33 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
34 | |||
33 | #include <linux/module.h> | 35 | #include <linux/module.h> |
34 | #include <linux/moduleparam.h> | 36 | #include <linux/moduleparam.h> |
35 | #include <linux/types.h> | 37 | #include <linux/types.h> |
@@ -47,7 +49,6 @@ | |||
47 | #include <asm/system.h> | 49 | #include <asm/system.h> |
48 | 50 | ||
49 | #define WATCHDOG_NAME "w83697ug/uf WDT" | 51 | #define WATCHDOG_NAME "w83697ug/uf WDT" |
50 | #define PFX WATCHDOG_NAME ": " | ||
51 | #define WATCHDOG_TIMEOUT 60 /* 60 sec default timeout */ | 52 | #define WATCHDOG_TIMEOUT 60 /* 60 sec default timeout */ |
52 | 53 | ||
53 | static unsigned long wdt_is_open; | 54 | static unsigned long wdt_is_open; |
@@ -91,8 +92,8 @@ static int w83697ug_select_wd_register(void) | |||
91 | version = inb(WDT_EFDR); | 92 | version = inb(WDT_EFDR); |
92 | 93 | ||
93 | if (version == 0x68) { /* W83697UG */ | 94 | if (version == 0x68) { /* W83697UG */ |
94 | printk(KERN_INFO PFX "Watchdog chip version 0x%02x = " | 95 | pr_info("Watchdog chip version 0x%02x = W83697UG/UF found at 0x%04x\n", |
95 | "W83697UG/UF found at 0x%04x\n", version, wdt_io); | 96 | version, wdt_io); |
96 | 97 | ||
97 | outb_p(0x2b, WDT_EFER); | 98 | outb_p(0x2b, WDT_EFER); |
98 | c = inb_p(WDT_EFDR); /* select WDT0 */ | 99 | c = inb_p(WDT_EFDR); /* select WDT0 */ |
@@ -101,7 +102,7 @@ static int w83697ug_select_wd_register(void) | |||
101 | outb_p(c, WDT_EFDR); /* set pin118 to WDT0 */ | 102 | outb_p(c, WDT_EFDR); /* set pin118 to WDT0 */ |
102 | 103 | ||
103 | } else { | 104 | } else { |
104 | printk(KERN_ERR PFX "No W83697UG/UF could be found\n"); | 105 | pr_err("No W83697UG/UF could be found\n"); |
105 | return -ENODEV; | 106 | return -ENODEV; |
106 | } | 107 | } |
107 | 108 | ||
@@ -131,8 +132,8 @@ static int w83697ug_init(void) | |||
131 | outb_p(0xF6, WDT_EFER); /* Select CRF6 */ | 132 | outb_p(0xF6, WDT_EFER); /* Select CRF6 */ |
132 | t = inb_p(WDT_EFDR); /* read CRF6 */ | 133 | t = inb_p(WDT_EFDR); /* read CRF6 */ |
133 | if (t != 0) { | 134 | if (t != 0) { |
134 | printk(KERN_INFO PFX "Watchdog already running." | 135 | pr_info("Watchdog already running. Resetting timeout to %d sec\n", |
135 | " Resetting timeout to %d sec\n", timeout); | 136 | timeout); |
136 | outb_p(timeout, WDT_EFDR); /* Write back to CRF6 */ | 137 | outb_p(timeout, WDT_EFDR); /* Write back to CRF6 */ |
137 | } | 138 | } |
138 | outb_p(0xF5, WDT_EFER); /* Select CRF5 */ | 139 | outb_p(0xF5, WDT_EFER); /* Select CRF5 */ |
@@ -286,8 +287,7 @@ static int wdt_close(struct inode *inode, struct file *file) | |||
286 | if (expect_close == 42) | 287 | if (expect_close == 42) |
287 | wdt_disable(); | 288 | wdt_disable(); |
288 | else { | 289 | else { |
289 | printk(KERN_CRIT PFX | 290 | pr_crit("Unexpected close, not stopping watchdog!\n"); |
290 | "Unexpected close, not stopping watchdog!\n"); | ||
291 | wdt_ping(); | 291 | wdt_ping(); |
292 | } | 292 | } |
293 | expect_close = 0; | 293 | expect_close = 0; |
@@ -340,18 +340,16 @@ static int __init wdt_init(void) | |||
340 | { | 340 | { |
341 | int ret; | 341 | int ret; |
342 | 342 | ||
343 | printk(KERN_INFO "WDT driver for the Winbond(TM) W83697UG/UF Super I/O chip initialising.\n"); | 343 | pr_info("WDT driver for the Winbond(TM) W83697UG/UF Super I/O chip initialising\n"); |
344 | 344 | ||
345 | if (wdt_set_heartbeat(timeout)) { | 345 | if (wdt_set_heartbeat(timeout)) { |
346 | wdt_set_heartbeat(WATCHDOG_TIMEOUT); | 346 | wdt_set_heartbeat(WATCHDOG_TIMEOUT); |
347 | printk(KERN_INFO PFX | 347 | pr_info("timeout value must be 1<=timeout<=255, using %d\n", |
348 | "timeout value must be 1<=timeout<=255, using %d\n", | ||
349 | WATCHDOG_TIMEOUT); | 348 | WATCHDOG_TIMEOUT); |
350 | } | 349 | } |
351 | 350 | ||
352 | if (!request_region(wdt_io, 1, WATCHDOG_NAME)) { | 351 | if (!request_region(wdt_io, 1, WATCHDOG_NAME)) { |
353 | printk(KERN_ERR PFX "I/O address 0x%04x already in use\n", | 352 | pr_err("I/O address 0x%04x already in use\n", wdt_io); |
354 | wdt_io); | ||
355 | ret = -EIO; | 353 | ret = -EIO; |
356 | goto out; | 354 | goto out; |
357 | } | 355 | } |
@@ -362,20 +360,18 @@ static int __init wdt_init(void) | |||
362 | 360 | ||
363 | ret = register_reboot_notifier(&wdt_notifier); | 361 | ret = register_reboot_notifier(&wdt_notifier); |
364 | if (ret != 0) { | 362 | if (ret != 0) { |
365 | printk(KERN_ERR PFX | 363 | pr_err("cannot register reboot notifier (err=%d)\n", ret); |
366 | "cannot register reboot notifier (err=%d)\n", ret); | ||
367 | goto unreg_regions; | 364 | goto unreg_regions; |
368 | } | 365 | } |
369 | 366 | ||
370 | ret = misc_register(&wdt_miscdev); | 367 | ret = misc_register(&wdt_miscdev); |
371 | if (ret != 0) { | 368 | if (ret != 0) { |
372 | printk(KERN_ERR PFX | 369 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
373 | "cannot register miscdev on minor=%d (err=%d)\n", | 370 | WATCHDOG_MINOR, ret); |
374 | WATCHDOG_MINOR, ret); | ||
375 | goto unreg_reboot; | 371 | goto unreg_reboot; |
376 | } | 372 | } |
377 | 373 | ||
378 | printk(KERN_INFO PFX "initialized. timeout=%d sec (nowayout=%d)\n", | 374 | pr_info("initialized. timeout=%d sec (nowayout=%d)\n", |
379 | timeout, nowayout); | 375 | timeout, nowayout); |
380 | 376 | ||
381 | out: | 377 | out: |