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/sbc60xxwdt.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/sbc60xxwdt.c')
-rw-r--r-- | drivers/watchdog/sbc60xxwdt.c | 37 |
1 files changed, 15 insertions, 22 deletions
diff --git a/drivers/watchdog/sbc60xxwdt.c b/drivers/watchdog/sbc60xxwdt.c index 626d0e8e56c3..1d0c971d8857 100644 --- a/drivers/watchdog/sbc60xxwdt.c +++ b/drivers/watchdog/sbc60xxwdt.c | |||
@@ -48,6 +48,8 @@ | |||
48 | * | 48 | * |
49 | */ | 49 | */ |
50 | 50 | ||
51 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
52 | |||
51 | #include <linux/module.h> | 53 | #include <linux/module.h> |
52 | #include <linux/moduleparam.h> | 54 | #include <linux/moduleparam.h> |
53 | #include <linux/types.h> | 55 | #include <linux/types.h> |
@@ -132,8 +134,7 @@ static void wdt_timer_ping(unsigned long data) | |||
132 | /* Re-set the timer interval */ | 134 | /* Re-set the timer interval */ |
133 | mod_timer(&timer, jiffies + WDT_INTERVAL); | 135 | mod_timer(&timer, jiffies + WDT_INTERVAL); |
134 | } else | 136 | } else |
135 | printk(KERN_WARNING PFX | 137 | pr_warn("Heartbeat lost! Will not ping the watchdog\n"); |
136 | "Heartbeat lost! Will not ping the watchdog\n"); | ||
137 | } | 138 | } |
138 | 139 | ||
139 | /* | 140 | /* |
@@ -146,7 +147,7 @@ static void wdt_startup(void) | |||
146 | 147 | ||
147 | /* Start the timer */ | 148 | /* Start the timer */ |
148 | mod_timer(&timer, jiffies + WDT_INTERVAL); | 149 | mod_timer(&timer, jiffies + WDT_INTERVAL); |
149 | printk(KERN_INFO PFX "Watchdog timer is now enabled.\n"); | 150 | pr_info("Watchdog timer is now enabled\n"); |
150 | } | 151 | } |
151 | 152 | ||
152 | static void wdt_turnoff(void) | 153 | static void wdt_turnoff(void) |
@@ -154,7 +155,7 @@ static void wdt_turnoff(void) | |||
154 | /* Stop the timer */ | 155 | /* Stop the timer */ |
155 | del_timer(&timer); | 156 | del_timer(&timer); |
156 | inb_p(wdt_stop); | 157 | inb_p(wdt_stop); |
157 | printk(KERN_INFO PFX "Watchdog timer is now disabled...\n"); | 158 | pr_info("Watchdog timer is now disabled...\n"); |
158 | } | 159 | } |
159 | 160 | ||
160 | static void wdt_keepalive(void) | 161 | static void wdt_keepalive(void) |
@@ -217,8 +218,7 @@ static int fop_close(struct inode *inode, struct file *file) | |||
217 | wdt_turnoff(); | 218 | wdt_turnoff(); |
218 | else { | 219 | else { |
219 | del_timer(&timer); | 220 | del_timer(&timer); |
220 | printk(KERN_CRIT PFX | 221 | pr_crit("device file closed unexpectedly. Will not stop the WDT!\n"); |
221 | "device file closed unexpectedly. Will not stop the WDT!\n"); | ||
222 | } | 222 | } |
223 | clear_bit(0, &wdt_is_open); | 223 | clear_bit(0, &wdt_is_open); |
224 | wdt_expect_close = 0; | 224 | wdt_expect_close = 0; |
@@ -335,14 +335,12 @@ static int __init sbc60xxwdt_init(void) | |||
335 | 335 | ||
336 | if (timeout < 1 || timeout > 3600) { /* arbitrary upper limit */ | 336 | if (timeout < 1 || timeout > 3600) { /* arbitrary upper limit */ |
337 | timeout = WATCHDOG_TIMEOUT; | 337 | timeout = WATCHDOG_TIMEOUT; |
338 | printk(KERN_INFO PFX | 338 | pr_info("timeout value must be 1 <= x <= 3600, using %d\n", |
339 | "timeout value must be 1 <= x <= 3600, using %d\n", | 339 | timeout); |
340 | timeout); | ||
341 | } | 340 | } |
342 | 341 | ||
343 | if (!request_region(wdt_start, 1, "SBC 60XX WDT")) { | 342 | if (!request_region(wdt_start, 1, "SBC 60XX WDT")) { |
344 | printk(KERN_ERR PFX "I/O address 0x%04x already in use\n", | 343 | pr_err("I/O address 0x%04x already in use\n", wdt_start); |
345 | wdt_start); | ||
346 | rc = -EIO; | 344 | rc = -EIO; |
347 | goto err_out; | 345 | goto err_out; |
348 | } | 346 | } |
@@ -350,9 +348,7 @@ static int __init sbc60xxwdt_init(void) | |||
350 | /* We cannot reserve 0x45 - the kernel already has! */ | 348 | /* We cannot reserve 0x45 - the kernel already has! */ |
351 | if (wdt_stop != 0x45 && wdt_stop != wdt_start) { | 349 | if (wdt_stop != 0x45 && wdt_stop != wdt_start) { |
352 | if (!request_region(wdt_stop, 1, "SBC 60XX WDT")) { | 350 | if (!request_region(wdt_stop, 1, "SBC 60XX WDT")) { |
353 | printk(KERN_ERR PFX | 351 | pr_err("I/O address 0x%04x already in use\n", wdt_stop); |
354 | "I/O address 0x%04x already in use\n", | ||
355 | wdt_stop); | ||
356 | rc = -EIO; | 352 | rc = -EIO; |
357 | goto err_out_region1; | 353 | goto err_out_region1; |
358 | } | 354 | } |
@@ -360,21 +356,18 @@ static int __init sbc60xxwdt_init(void) | |||
360 | 356 | ||
361 | rc = register_reboot_notifier(&wdt_notifier); | 357 | rc = register_reboot_notifier(&wdt_notifier); |
362 | if (rc) { | 358 | if (rc) { |
363 | printk(KERN_ERR PFX | 359 | pr_err("cannot register reboot notifier (err=%d)\n", rc); |
364 | "cannot register reboot notifier (err=%d)\n", rc); | ||
365 | goto err_out_region2; | 360 | goto err_out_region2; |
366 | } | 361 | } |
367 | 362 | ||
368 | rc = misc_register(&wdt_miscdev); | 363 | rc = misc_register(&wdt_miscdev); |
369 | if (rc) { | 364 | if (rc) { |
370 | printk(KERN_ERR PFX | 365 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
371 | "cannot register miscdev on minor=%d (err=%d)\n", | 366 | wdt_miscdev.minor, rc); |
372 | wdt_miscdev.minor, rc); | ||
373 | goto err_out_reboot; | 367 | goto err_out_reboot; |
374 | } | 368 | } |
375 | printk(KERN_INFO PFX | 369 | pr_info("WDT driver for 60XX single board computer initialised. timeout=%d sec (nowayout=%d)\n", |
376 | "WDT driver for 60XX single board computer initialised. " | 370 | timeout, nowayout); |
377 | "timeout=%d sec (nowayout=%d)\n", timeout, nowayout); | ||
378 | 371 | ||
379 | return 0; | 372 | return 0; |
380 | 373 | ||