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/sp5100_tco.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/sp5100_tco.c')
-rw-r--r-- | drivers/watchdog/sp5100_tco.c | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/drivers/watchdog/sp5100_tco.c b/drivers/watchdog/sp5100_tco.c index 87e0527669d8..954a7b6334c4 100644 --- a/drivers/watchdog/sp5100_tco.c +++ b/drivers/watchdog/sp5100_tco.c | |||
@@ -20,6 +20,8 @@ | |||
20 | * Includes, defines, variables, module parameters, ... | 20 | * Includes, defines, variables, module parameters, ... |
21 | */ | 21 | */ |
22 | 22 | ||
23 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
24 | |||
23 | #include <linux/module.h> | 25 | #include <linux/module.h> |
24 | #include <linux/moduleparam.h> | 26 | #include <linux/moduleparam.h> |
25 | #include <linux/types.h> | 27 | #include <linux/types.h> |
@@ -39,7 +41,6 @@ | |||
39 | #define TCO_VERSION "0.01" | 41 | #define TCO_VERSION "0.01" |
40 | #define TCO_MODULE_NAME "SP5100 TCO timer" | 42 | #define TCO_MODULE_NAME "SP5100 TCO timer" |
41 | #define TCO_DRIVER_NAME TCO_MODULE_NAME ", v" TCO_VERSION | 43 | #define TCO_DRIVER_NAME TCO_MODULE_NAME ", v" TCO_VERSION |
42 | #define PFX TCO_MODULE_NAME ": " | ||
43 | 44 | ||
44 | /* internal variables */ | 45 | /* internal variables */ |
45 | static u32 tcobase_phys; | 46 | static u32 tcobase_phys; |
@@ -143,8 +144,7 @@ static int sp5100_tco_release(struct inode *inode, struct file *file) | |||
143 | if (tco_expect_close == 42) { | 144 | if (tco_expect_close == 42) { |
144 | tco_timer_stop(); | 145 | tco_timer_stop(); |
145 | } else { | 146 | } else { |
146 | printk(KERN_CRIT PFX | 147 | pr_crit("Unexpected close, not stopping watchdog!\n"); |
147 | "Unexpected close, not stopping watchdog!\n"); | ||
148 | tco_timer_keepalive(); | 148 | tco_timer_keepalive(); |
149 | } | 149 | } |
150 | clear_bit(0, &timer_alive); | 150 | clear_bit(0, &timer_alive); |
@@ -290,8 +290,7 @@ static unsigned char __devinit sp5100_tco_setupdevice(void) | |||
290 | /* Request the IO ports used by this driver */ | 290 | /* Request the IO ports used by this driver */ |
291 | pm_iobase = SP5100_IO_PM_INDEX_REG; | 291 | pm_iobase = SP5100_IO_PM_INDEX_REG; |
292 | if (!request_region(pm_iobase, SP5100_PM_IOPORTS_SIZE, "SP5100 TCO")) { | 292 | if (!request_region(pm_iobase, SP5100_PM_IOPORTS_SIZE, "SP5100 TCO")) { |
293 | printk(KERN_ERR PFX "I/O address 0x%04x already in use\n", | 293 | pr_err("I/O address 0x%04x already in use\n", pm_iobase); |
294 | pm_iobase); | ||
295 | goto exit; | 294 | goto exit; |
296 | } | 295 | } |
297 | 296 | ||
@@ -308,15 +307,14 @@ static unsigned char __devinit sp5100_tco_setupdevice(void) | |||
308 | 307 | ||
309 | if (!request_mem_region_exclusive(val, SP5100_WDT_MEM_MAP_SIZE, | 308 | if (!request_mem_region_exclusive(val, SP5100_WDT_MEM_MAP_SIZE, |
310 | "SP5100 TCO")) { | 309 | "SP5100 TCO")) { |
311 | printk(KERN_ERR PFX "mmio address 0x%04x already in use\n", | 310 | pr_err("mmio address 0x%04x already in use\n", val); |
312 | val); | ||
313 | goto unreg_region; | 311 | goto unreg_region; |
314 | } | 312 | } |
315 | tcobase_phys = val; | 313 | tcobase_phys = val; |
316 | 314 | ||
317 | tcobase = ioremap(val, SP5100_WDT_MEM_MAP_SIZE); | 315 | tcobase = ioremap(val, SP5100_WDT_MEM_MAP_SIZE); |
318 | if (tcobase == 0) { | 316 | if (tcobase == 0) { |
319 | printk(KERN_ERR PFX "failed to get tcobase address\n"); | 317 | pr_err("failed to get tcobase address\n"); |
320 | goto unreg_mem_region; | 318 | goto unreg_mem_region; |
321 | } | 319 | } |
322 | 320 | ||
@@ -375,9 +373,9 @@ static int __devinit sp5100_tco_init(struct platform_device *dev) | |||
375 | return -ENODEV; | 373 | return -ENODEV; |
376 | 374 | ||
377 | /* Check to see if last reboot was due to watchdog timeout */ | 375 | /* Check to see if last reboot was due to watchdog timeout */ |
378 | printk(KERN_INFO PFX "Watchdog reboot %sdetected.\n", | 376 | pr_info("Watchdog reboot %sdetected\n", |
379 | readl(SP5100_WDT_CONTROL(tcobase)) & SP5100_PM_WATCHDOG_FIRED ? | 377 | readl(SP5100_WDT_CONTROL(tcobase)) & SP5100_PM_WATCHDOG_FIRED ? |
380 | "" : "not "); | 378 | "" : "not "); |
381 | 379 | ||
382 | /* Clear out the old status */ | 380 | /* Clear out the old status */ |
383 | val = readl(SP5100_WDT_CONTROL(tcobase)); | 381 | val = readl(SP5100_WDT_CONTROL(tcobase)); |
@@ -395,16 +393,14 @@ static int __devinit sp5100_tco_init(struct platform_device *dev) | |||
395 | 393 | ||
396 | ret = misc_register(&sp5100_tco_miscdev); | 394 | ret = misc_register(&sp5100_tco_miscdev); |
397 | if (ret != 0) { | 395 | if (ret != 0) { |
398 | printk(KERN_ERR PFX "cannot register miscdev on minor=" | 396 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
399 | "%d (err=%d)\n", | ||
400 | WATCHDOG_MINOR, ret); | 397 | WATCHDOG_MINOR, ret); |
401 | goto exit; | 398 | goto exit; |
402 | } | 399 | } |
403 | 400 | ||
404 | clear_bit(0, &timer_alive); | 401 | clear_bit(0, &timer_alive); |
405 | 402 | ||
406 | printk(KERN_INFO PFX "initialized (0x%p). heartbeat=%d sec" | 403 | pr_info("initialized (0x%p). heartbeat=%d sec (nowayout=%d)\n", |
407 | " (nowayout=%d)\n", | ||
408 | tcobase, heartbeat, nowayout); | 404 | tcobase, heartbeat, nowayout); |
409 | 405 | ||
410 | return 0; | 406 | return 0; |
@@ -455,8 +451,7 @@ static int __init sp5100_tco_init_module(void) | |||
455 | { | 451 | { |
456 | int err; | 452 | int err; |
457 | 453 | ||
458 | printk(KERN_INFO PFX "SP5100 TCO WatchDog Timer Driver v%s\n", | 454 | pr_info("SP5100 TCO WatchDog Timer Driver v%s\n", TCO_VERSION); |
459 | TCO_VERSION); | ||
460 | 455 | ||
461 | err = platform_driver_register(&sp5100_tco_driver); | 456 | err = platform_driver_register(&sp5100_tco_driver); |
462 | if (err) | 457 | if (err) |
@@ -480,7 +475,7 @@ static void __exit sp5100_tco_cleanup_module(void) | |||
480 | { | 475 | { |
481 | platform_device_unregister(sp5100_tco_platform_device); | 476 | platform_device_unregister(sp5100_tco_platform_device); |
482 | platform_driver_unregister(&sp5100_tco_driver); | 477 | platform_driver_unregister(&sp5100_tco_driver); |
483 | printk(KERN_INFO PFX "SP5100 TCO Watchdog Module Unloaded.\n"); | 478 | pr_info("SP5100 TCO Watchdog Module Unloaded\n"); |
484 | } | 479 | } |
485 | 480 | ||
486 | module_init(sp5100_tco_init_module); | 481 | module_init(sp5100_tco_init_module); |