diff options
author | Joe Perches <joe@perches.com> | 2012-02-15 18:06:19 -0500 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2012-03-27 13:59:26 -0400 |
commit | 27c766aaacb265d625dc634bf7903f7f9fd0c697 (patch) | |
tree | 06b399d21dec006bc0a3e1c6685b076753e19b94 /drivers/watchdog/advantechwdt.c | |
parent | 7cbc353540c31ffaf65ad44d89b955be0f1d04dc (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/advantechwdt.c')
-rw-r--r-- | drivers/watchdog/advantechwdt.c | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/drivers/watchdog/advantechwdt.c b/drivers/watchdog/advantechwdt.c index 4d40965d2c9f..986258a06676 100644 --- a/drivers/watchdog/advantechwdt.c +++ b/drivers/watchdog/advantechwdt.c | |||
@@ -28,6 +28,8 @@ | |||
28 | * add wdt_start and wdt_stop as parameters. | 28 | * add wdt_start and wdt_stop as parameters. |
29 | */ | 29 | */ |
30 | 30 | ||
31 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
32 | |||
31 | #include <linux/module.h> | 33 | #include <linux/module.h> |
32 | #include <linux/moduleparam.h> | 34 | #include <linux/moduleparam.h> |
33 | #include <linux/types.h> | 35 | #include <linux/types.h> |
@@ -43,7 +45,6 @@ | |||
43 | #include <asm/system.h> | 45 | #include <asm/system.h> |
44 | 46 | ||
45 | #define DRV_NAME "advantechwdt" | 47 | #define DRV_NAME "advantechwdt" |
46 | #define PFX DRV_NAME ": " | ||
47 | #define WATCHDOG_NAME "Advantech WDT" | 48 | #define WATCHDOG_NAME "Advantech WDT" |
48 | #define WATCHDOG_TIMEOUT 60 /* 60 sec default timeout */ | 49 | #define WATCHDOG_TIMEOUT 60 /* 60 sec default timeout */ |
49 | 50 | ||
@@ -207,8 +208,7 @@ static int advwdt_close(struct inode *inode, struct file *file) | |||
207 | if (adv_expect_close == 42) { | 208 | if (adv_expect_close == 42) { |
208 | advwdt_disable(); | 209 | advwdt_disable(); |
209 | } else { | 210 | } else { |
210 | printk(KERN_CRIT PFX | 211 | pr_crit("Unexpected close, not stopping watchdog!\n"); |
211 | "Unexpected close, not stopping watchdog!\n"); | ||
212 | advwdt_ping(); | 212 | advwdt_ping(); |
213 | } | 213 | } |
214 | clear_bit(0, &advwdt_is_open); | 214 | clear_bit(0, &advwdt_is_open); |
@@ -245,18 +245,15 @@ static int __devinit advwdt_probe(struct platform_device *dev) | |||
245 | 245 | ||
246 | if (wdt_stop != wdt_start) { | 246 | if (wdt_stop != wdt_start) { |
247 | if (!request_region(wdt_stop, 1, WATCHDOG_NAME)) { | 247 | if (!request_region(wdt_stop, 1, WATCHDOG_NAME)) { |
248 | printk(KERN_ERR PFX | 248 | pr_err("I/O address 0x%04x already in use\n", |
249 | "I/O address 0x%04x already in use\n", | 249 | wdt_stop); |
250 | wdt_stop); | ||
251 | ret = -EIO; | 250 | ret = -EIO; |
252 | goto out; | 251 | goto out; |
253 | } | 252 | } |
254 | } | 253 | } |
255 | 254 | ||
256 | if (!request_region(wdt_start, 1, WATCHDOG_NAME)) { | 255 | if (!request_region(wdt_start, 1, WATCHDOG_NAME)) { |
257 | printk(KERN_ERR PFX | 256 | pr_err("I/O address 0x%04x already in use\n", wdt_start); |
258 | "I/O address 0x%04x already in use\n", | ||
259 | wdt_start); | ||
260 | ret = -EIO; | 257 | ret = -EIO; |
261 | goto unreg_stop; | 258 | goto unreg_stop; |
262 | } | 259 | } |
@@ -265,18 +262,16 @@ static int __devinit advwdt_probe(struct platform_device *dev) | |||
265 | * if not reset to the default */ | 262 | * if not reset to the default */ |
266 | if (advwdt_set_heartbeat(timeout)) { | 263 | if (advwdt_set_heartbeat(timeout)) { |
267 | advwdt_set_heartbeat(WATCHDOG_TIMEOUT); | 264 | advwdt_set_heartbeat(WATCHDOG_TIMEOUT); |
268 | printk(KERN_INFO PFX | 265 | pr_info("timeout value must be 1<=x<=63, using %d\n", timeout); |
269 | "timeout value must be 1<=x<=63, using %d\n", timeout); | ||
270 | } | 266 | } |
271 | 267 | ||
272 | ret = misc_register(&advwdt_miscdev); | 268 | ret = misc_register(&advwdt_miscdev); |
273 | if (ret != 0) { | 269 | if (ret != 0) { |
274 | printk(KERN_ERR PFX | 270 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
275 | "cannot register miscdev on minor=%d (err=%d)\n", | 271 | WATCHDOG_MINOR, ret); |
276 | WATCHDOG_MINOR, ret); | ||
277 | goto unreg_regions; | 272 | goto unreg_regions; |
278 | } | 273 | } |
279 | printk(KERN_INFO PFX "initialized. timeout=%d sec (nowayout=%d)\n", | 274 | pr_info("initialized. timeout=%d sec (nowayout=%d)\n", |
280 | timeout, nowayout); | 275 | timeout, nowayout); |
281 | out: | 276 | out: |
282 | return ret; | 277 | return ret; |
@@ -318,8 +313,7 @@ static int __init advwdt_init(void) | |||
318 | { | 313 | { |
319 | int err; | 314 | int err; |
320 | 315 | ||
321 | printk(KERN_INFO | 316 | pr_info("WDT driver for Advantech single board computer initialising\n"); |
322 | "WDT driver for Advantech single board computer initialising.\n"); | ||
323 | 317 | ||
324 | err = platform_driver_register(&advwdt_driver); | 318 | err = platform_driver_register(&advwdt_driver); |
325 | if (err) | 319 | if (err) |
@@ -343,7 +337,7 @@ static void __exit advwdt_exit(void) | |||
343 | { | 337 | { |
344 | platform_device_unregister(advwdt_platform_device); | 338 | platform_device_unregister(advwdt_platform_device); |
345 | platform_driver_unregister(&advwdt_driver); | 339 | platform_driver_unregister(&advwdt_driver); |
346 | printk(KERN_INFO PFX "Watchdog Module Unloaded.\n"); | 340 | pr_info("Watchdog Module Unloaded\n"); |
347 | } | 341 | } |
348 | 342 | ||
349 | module_init(advwdt_init); | 343 | module_init(advwdt_init); |