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/sc520_wdt.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/sc520_wdt.c')
-rw-r--r-- | drivers/watchdog/sc520_wdt.c | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/drivers/watchdog/sc520_wdt.c b/drivers/watchdog/sc520_wdt.c index b2840409ebc7..e975b3354381 100644 --- a/drivers/watchdog/sc520_wdt.c +++ b/drivers/watchdog/sc520_wdt.c | |||
@@ -52,6 +52,8 @@ | |||
52 | * This driver uses memory mapped IO, and spinlock. | 52 | * This driver uses memory mapped IO, and spinlock. |
53 | */ | 53 | */ |
54 | 54 | ||
55 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
56 | |||
55 | #include <linux/module.h> | 57 | #include <linux/module.h> |
56 | #include <linux/moduleparam.h> | 58 | #include <linux/moduleparam.h> |
57 | #include <linux/types.h> | 59 | #include <linux/types.h> |
@@ -69,9 +71,6 @@ | |||
69 | 71 | ||
70 | #include <asm/system.h> | 72 | #include <asm/system.h> |
71 | 73 | ||
72 | #define OUR_NAME "sc520_wdt" | ||
73 | #define PFX OUR_NAME ": " | ||
74 | |||
75 | /* | 74 | /* |
76 | * The AMD Elan SC520 timeout value is 492us times a power of 2 (0-7) | 75 | * The AMD Elan SC520 timeout value is 492us times a power of 2 (0-7) |
77 | * | 76 | * |
@@ -151,8 +150,7 @@ static void wdt_timer_ping(unsigned long data) | |||
151 | /* Re-set the timer interval */ | 150 | /* Re-set the timer interval */ |
152 | mod_timer(&timer, jiffies + WDT_INTERVAL); | 151 | mod_timer(&timer, jiffies + WDT_INTERVAL); |
153 | } else | 152 | } else |
154 | printk(KERN_WARNING PFX | 153 | pr_warn("Heartbeat lost! Will not ping the watchdog\n"); |
155 | "Heartbeat lost! Will not ping the watchdog\n"); | ||
156 | } | 154 | } |
157 | 155 | ||
158 | /* | 156 | /* |
@@ -187,7 +185,7 @@ static int wdt_startup(void) | |||
187 | /* Start the watchdog */ | 185 | /* Start the watchdog */ |
188 | wdt_config(WDT_ENB | WDT_WRST_ENB | WDT_EXP_SEL_04); | 186 | wdt_config(WDT_ENB | WDT_WRST_ENB | WDT_EXP_SEL_04); |
189 | 187 | ||
190 | printk(KERN_INFO PFX "Watchdog timer is now enabled.\n"); | 188 | pr_info("Watchdog timer is now enabled\n"); |
191 | return 0; | 189 | return 0; |
192 | } | 190 | } |
193 | 191 | ||
@@ -199,7 +197,7 @@ static int wdt_turnoff(void) | |||
199 | /* Stop the watchdog */ | 197 | /* Stop the watchdog */ |
200 | wdt_config(0); | 198 | wdt_config(0); |
201 | 199 | ||
202 | printk(KERN_INFO PFX "Watchdog timer is now disabled...\n"); | 200 | pr_info("Watchdog timer is now disabled...\n"); |
203 | return 0; | 201 | return 0; |
204 | } | 202 | } |
205 | 203 | ||
@@ -270,8 +268,7 @@ static int fop_close(struct inode *inode, struct file *file) | |||
270 | if (wdt_expect_close == 42) | 268 | if (wdt_expect_close == 42) |
271 | wdt_turnoff(); | 269 | wdt_turnoff(); |
272 | else { | 270 | else { |
273 | printk(KERN_CRIT PFX | 271 | pr_crit("Unexpected close, not stopping watchdog!\n"); |
274 | "Unexpected close, not stopping watchdog!\n"); | ||
275 | wdt_keepalive(); | 272 | wdt_keepalive(); |
276 | } | 273 | } |
277 | clear_bit(0, &wdt_is_open); | 274 | clear_bit(0, &wdt_is_open); |
@@ -393,36 +390,32 @@ static int __init sc520_wdt_init(void) | |||
393 | if not reset to the default */ | 390 | if not reset to the default */ |
394 | if (wdt_set_heartbeat(timeout)) { | 391 | if (wdt_set_heartbeat(timeout)) { |
395 | wdt_set_heartbeat(WATCHDOG_TIMEOUT); | 392 | wdt_set_heartbeat(WATCHDOG_TIMEOUT); |
396 | printk(KERN_INFO PFX | 393 | pr_info("timeout value must be 1 <= timeout <= 3600, using %d\n", |
397 | "timeout value must be 1 <= timeout <= 3600, using %d\n", | 394 | WATCHDOG_TIMEOUT); |
398 | WATCHDOG_TIMEOUT); | ||
399 | } | 395 | } |
400 | 396 | ||
401 | wdtmrctl = ioremap(MMCR_BASE + OFFS_WDTMRCTL, 2); | 397 | wdtmrctl = ioremap(MMCR_BASE + OFFS_WDTMRCTL, 2); |
402 | if (!wdtmrctl) { | 398 | if (!wdtmrctl) { |
403 | printk(KERN_ERR PFX "Unable to remap memory\n"); | 399 | pr_err("Unable to remap memory\n"); |
404 | rc = -ENOMEM; | 400 | rc = -ENOMEM; |
405 | goto err_out_region2; | 401 | goto err_out_region2; |
406 | } | 402 | } |
407 | 403 | ||
408 | rc = register_reboot_notifier(&wdt_notifier); | 404 | rc = register_reboot_notifier(&wdt_notifier); |
409 | if (rc) { | 405 | if (rc) { |
410 | printk(KERN_ERR PFX | 406 | pr_err("cannot register reboot notifier (err=%d)\n", rc); |
411 | "cannot register reboot notifier (err=%d)\n", rc); | ||
412 | goto err_out_ioremap; | 407 | goto err_out_ioremap; |
413 | } | 408 | } |
414 | 409 | ||
415 | rc = misc_register(&wdt_miscdev); | 410 | rc = misc_register(&wdt_miscdev); |
416 | if (rc) { | 411 | if (rc) { |
417 | printk(KERN_ERR PFX | 412 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
418 | "cannot register miscdev on minor=%d (err=%d)\n", | 413 | WATCHDOG_MINOR, rc); |
419 | WATCHDOG_MINOR, rc); | ||
420 | goto err_out_notifier; | 414 | goto err_out_notifier; |
421 | } | 415 | } |
422 | 416 | ||
423 | printk(KERN_INFO PFX | 417 | pr_info("WDT driver for SC520 initialised. timeout=%d sec (nowayout=%d)\n", |
424 | "WDT driver for SC520 initialised. timeout=%d sec (nowayout=%d)\n", | 418 | timeout, nowayout); |
425 | timeout, nowayout); | ||
426 | 419 | ||
427 | return 0; | 420 | return 0; |
428 | 421 | ||