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/machzwd.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/machzwd.c')
-rw-r--r-- | drivers/watchdog/machzwd.c | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/drivers/watchdog/machzwd.c b/drivers/watchdog/machzwd.c index 1332b838cc58..a2ecc9656920 100644 --- a/drivers/watchdog/machzwd.c +++ b/drivers/watchdog/machzwd.c | |||
@@ -28,6 +28,8 @@ | |||
28 | * Added nowayout module option to override CONFIG_WATCHDOG_NOWAYOUT | 28 | * Added nowayout module option to override CONFIG_WATCHDOG_NOWAYOUT |
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> |
@@ -141,10 +143,10 @@ static unsigned long next_heartbeat; | |||
141 | #define ZF_CTIMEOUT 0xffff | 143 | #define ZF_CTIMEOUT 0xffff |
142 | 144 | ||
143 | #ifndef ZF_DEBUG | 145 | #ifndef ZF_DEBUG |
144 | # define dprintk(format, args...) | 146 | #define dprintk(format, args...) |
145 | #else | 147 | #else |
146 | # define dprintk(format, args...) printk(KERN_DEBUG PFX \ | 148 | #define dprintk(format, args...) \ |
147 | ":%s:%d: " format, __func__, __LINE__ , ## args) | 149 | pr_debug(":%s:%d: " format, __func__, __LINE__ , ## args) |
148 | #endif | 150 | #endif |
149 | 151 | ||
150 | 152 | ||
@@ -203,7 +205,7 @@ static void zf_timer_off(void) | |||
203 | zf_set_control(ctrl_reg); | 205 | zf_set_control(ctrl_reg); |
204 | spin_unlock_irqrestore(&zf_port_lock, flags); | 206 | spin_unlock_irqrestore(&zf_port_lock, flags); |
205 | 207 | ||
206 | printk(KERN_INFO PFX ": Watchdog timer is now disabled\n"); | 208 | pr_info("Watchdog timer is now disabled\n"); |
207 | } | 209 | } |
208 | 210 | ||
209 | 211 | ||
@@ -233,7 +235,7 @@ static void zf_timer_on(void) | |||
233 | zf_set_control(ctrl_reg); | 235 | zf_set_control(ctrl_reg); |
234 | spin_unlock_irqrestore(&zf_port_lock, flags); | 236 | spin_unlock_irqrestore(&zf_port_lock, flags); |
235 | 237 | ||
236 | printk(KERN_INFO PFX ": Watchdog timer is now enabled\n"); | 238 | pr_info("Watchdog timer is now enabled\n"); |
237 | } | 239 | } |
238 | 240 | ||
239 | 241 | ||
@@ -263,7 +265,7 @@ static void zf_ping(unsigned long data) | |||
263 | 265 | ||
264 | mod_timer(&zf_timer, jiffies + ZF_HW_TIMEO); | 266 | mod_timer(&zf_timer, jiffies + ZF_HW_TIMEO); |
265 | } else | 267 | } else |
266 | printk(KERN_CRIT PFX ": I will reset your machine\n"); | 268 | pr_crit("I will reset your machine\n"); |
267 | } | 269 | } |
268 | 270 | ||
269 | static ssize_t zf_write(struct file *file, const char __user *buf, size_t count, | 271 | static ssize_t zf_write(struct file *file, const char __user *buf, size_t count, |
@@ -342,8 +344,7 @@ static int zf_close(struct inode *inode, struct file *file) | |||
342 | zf_timer_off(); | 344 | zf_timer_off(); |
343 | else { | 345 | else { |
344 | del_timer(&zf_timer); | 346 | del_timer(&zf_timer); |
345 | printk(KERN_ERR PFX ": device file closed unexpectedly. " | 347 | pr_err("device file closed unexpectedly. Will not stop the WDT!\n"); |
346 | "Will not stop the WDT!\n"); | ||
347 | } | 348 | } |
348 | clear_bit(0, &zf_is_open); | 349 | clear_bit(0, &zf_is_open); |
349 | zf_expect_close = 0; | 350 | zf_expect_close = 0; |
@@ -390,19 +391,18 @@ static void __init zf_show_action(int act) | |||
390 | { | 391 | { |
391 | static const char * const str[] = { "RESET", "SMI", "NMI", "SCI" }; | 392 | static const char * const str[] = { "RESET", "SMI", "NMI", "SCI" }; |
392 | 393 | ||
393 | printk(KERN_INFO PFX ": Watchdog using action = %s\n", str[act]); | 394 | pr_info("Watchdog using action = %s\n", str[act]); |
394 | } | 395 | } |
395 | 396 | ||
396 | static int __init zf_init(void) | 397 | static int __init zf_init(void) |
397 | { | 398 | { |
398 | int ret; | 399 | int ret; |
399 | 400 | ||
400 | printk(KERN_INFO PFX | 401 | pr_info("MachZ ZF-Logic Watchdog driver initializing\n"); |
401 | ": MachZ ZF-Logic Watchdog driver initializing.\n"); | ||
402 | 402 | ||
403 | ret = zf_get_ZFL_version(); | 403 | ret = zf_get_ZFL_version(); |
404 | if (!ret || ret == 0xffff) { | 404 | if (!ret || ret == 0xffff) { |
405 | printk(KERN_WARNING PFX ": no ZF-Logic found\n"); | 405 | pr_warn("no ZF-Logic found\n"); |
406 | return -ENODEV; | 406 | return -ENODEV; |
407 | } | 407 | } |
408 | 408 | ||
@@ -414,23 +414,20 @@ static int __init zf_init(void) | |||
414 | zf_show_action(action); | 414 | zf_show_action(action); |
415 | 415 | ||
416 | if (!request_region(ZF_IOBASE, 3, "MachZ ZFL WDT")) { | 416 | if (!request_region(ZF_IOBASE, 3, "MachZ ZFL WDT")) { |
417 | printk(KERN_ERR "cannot reserve I/O ports at %d\n", | 417 | pr_err("cannot reserve I/O ports at %d\n", ZF_IOBASE); |
418 | ZF_IOBASE); | ||
419 | ret = -EBUSY; | 418 | ret = -EBUSY; |
420 | goto no_region; | 419 | goto no_region; |
421 | } | 420 | } |
422 | 421 | ||
423 | ret = register_reboot_notifier(&zf_notifier); | 422 | ret = register_reboot_notifier(&zf_notifier); |
424 | if (ret) { | 423 | if (ret) { |
425 | printk(KERN_ERR "can't register reboot notifier (err=%d)\n", | 424 | pr_err("can't register reboot notifier (err=%d)\n", ret); |
426 | ret); | ||
427 | goto no_reboot; | 425 | goto no_reboot; |
428 | } | 426 | } |
429 | 427 | ||
430 | ret = misc_register(&zf_miscdev); | 428 | ret = misc_register(&zf_miscdev); |
431 | if (ret) { | 429 | if (ret) { |
432 | printk(KERN_ERR "can't misc_register on minor=%d\n", | 430 | pr_err("can't misc_register on minor=%d\n", WATCHDOG_MINOR); |
433 | WATCHDOG_MINOR); | ||
434 | goto no_misc; | 431 | goto no_misc; |
435 | } | 432 | } |
436 | 433 | ||