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/eurotechwdt.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/eurotechwdt.c')
-rw-r--r-- | drivers/watchdog/eurotechwdt.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/drivers/watchdog/eurotechwdt.c b/drivers/watchdog/eurotechwdt.c index 3946c51099c0..22d967a5ac8c 100644 --- a/drivers/watchdog/eurotechwdt.c +++ b/drivers/watchdog/eurotechwdt.c | |||
@@ -45,6 +45,8 @@ | |||
45 | * of the on-board SUPER I/O device SMSC FDC 37B782. | 45 | * of the on-board SUPER I/O device SMSC FDC 37B782. |
46 | */ | 46 | */ |
47 | 47 | ||
48 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
49 | |||
48 | #include <linux/interrupt.h> | 50 | #include <linux/interrupt.h> |
49 | #include <linux/module.h> | 51 | #include <linux/module.h> |
50 | #include <linux/moduleparam.h> | 52 | #include <linux/moduleparam.h> |
@@ -144,11 +146,11 @@ static void eurwdt_activate_timer(void) | |||
144 | 146 | ||
145 | /* Setting interrupt line */ | 147 | /* Setting interrupt line */ |
146 | if (irq == 2 || irq > 15 || irq < 0) { | 148 | if (irq == 2 || irq > 15 || irq < 0) { |
147 | printk(KERN_ERR ": invalid irq number\n"); | 149 | pr_err("invalid irq number\n"); |
148 | irq = 0; /* if invalid we disable interrupt */ | 150 | irq = 0; /* if invalid we disable interrupt */ |
149 | } | 151 | } |
150 | if (irq == 0) | 152 | if (irq == 0) |
151 | printk(KERN_INFO ": interrupt disabled\n"); | 153 | pr_info("interrupt disabled\n"); |
152 | 154 | ||
153 | eurwdt_write_reg(WDT_TIMER_CFG, irq << 4); | 155 | eurwdt_write_reg(WDT_TIMER_CFG, irq << 4); |
154 | 156 | ||
@@ -163,12 +165,12 @@ static void eurwdt_activate_timer(void) | |||
163 | 165 | ||
164 | static irqreturn_t eurwdt_interrupt(int irq, void *dev_id) | 166 | static irqreturn_t eurwdt_interrupt(int irq, void *dev_id) |
165 | { | 167 | { |
166 | printk(KERN_CRIT "timeout WDT timeout\n"); | 168 | pr_crit("timeout WDT timeout\n"); |
167 | 169 | ||
168 | #ifdef ONLY_TESTING | 170 | #ifdef ONLY_TESTING |
169 | printk(KERN_CRIT "Would Reboot.\n"); | 171 | pr_crit("Would Reboot\n"); |
170 | #else | 172 | #else |
171 | printk(KERN_CRIT "Initiating system reboot.\n"); | 173 | pr_crit("Initiating system reboot\n"); |
172 | emergency_restart(); | 174 | emergency_restart(); |
173 | #endif | 175 | #endif |
174 | return IRQ_HANDLED; | 176 | return IRQ_HANDLED; |
@@ -335,8 +337,7 @@ static int eurwdt_release(struct inode *inode, struct file *file) | |||
335 | if (eur_expect_close == 42) | 337 | if (eur_expect_close == 42) |
336 | eurwdt_disable_timer(); | 338 | eurwdt_disable_timer(); |
337 | else { | 339 | else { |
338 | printk(KERN_CRIT | 340 | pr_crit("Unexpected close, not stopping watchdog!\n"); |
339 | "eurwdt: Unexpected close, not stopping watchdog!\n"); | ||
340 | eurwdt_ping(); | 341 | eurwdt_ping(); |
341 | } | 342 | } |
342 | clear_bit(0, &eurwdt_is_open); | 343 | clear_bit(0, &eurwdt_is_open); |
@@ -429,35 +430,32 @@ static int __init eurwdt_init(void) | |||
429 | 430 | ||
430 | ret = request_irq(irq, eurwdt_interrupt, 0, "eurwdt", NULL); | 431 | ret = request_irq(irq, eurwdt_interrupt, 0, "eurwdt", NULL); |
431 | if (ret) { | 432 | if (ret) { |
432 | printk(KERN_ERR "eurwdt: IRQ %d is not free.\n", irq); | 433 | pr_err("IRQ %d is not free\n", irq); |
433 | goto out; | 434 | goto out; |
434 | } | 435 | } |
435 | 436 | ||
436 | if (!request_region(io, 2, "eurwdt")) { | 437 | if (!request_region(io, 2, "eurwdt")) { |
437 | printk(KERN_ERR "eurwdt: IO %X is not free.\n", io); | 438 | pr_err("IO %X is not free\n", io); |
438 | ret = -EBUSY; | 439 | ret = -EBUSY; |
439 | goto outirq; | 440 | goto outirq; |
440 | } | 441 | } |
441 | 442 | ||
442 | ret = register_reboot_notifier(&eurwdt_notifier); | 443 | ret = register_reboot_notifier(&eurwdt_notifier); |
443 | if (ret) { | 444 | if (ret) { |
444 | printk(KERN_ERR | 445 | pr_err("can't register reboot notifier (err=%d)\n", ret); |
445 | "eurwdt: can't register reboot notifier (err=%d)\n", ret); | ||
446 | goto outreg; | 446 | goto outreg; |
447 | } | 447 | } |
448 | 448 | ||
449 | ret = misc_register(&eurwdt_miscdev); | 449 | ret = misc_register(&eurwdt_miscdev); |
450 | if (ret) { | 450 | if (ret) { |
451 | printk(KERN_ERR "eurwdt: can't misc_register on minor=%d\n", | 451 | pr_err("can't misc_register on minor=%d\n", WATCHDOG_MINOR); |
452 | WATCHDOG_MINOR); | ||
453 | goto outreboot; | 452 | goto outreboot; |
454 | } | 453 | } |
455 | 454 | ||
456 | eurwdt_unlock_chip(); | 455 | eurwdt_unlock_chip(); |
457 | 456 | ||
458 | ret = 0; | 457 | ret = 0; |
459 | printk(KERN_INFO "Eurotech WDT driver 0.01 at %X (Interrupt %d)" | 458 | pr_info("Eurotech WDT driver 0.01 at %X (Interrupt %d) - timeout event: %s\n", |
460 | " - timeout event: %s\n", | ||
461 | io, irq, (!strcmp("int", ev) ? "int" : "reboot")); | 459 | io, irq, (!strcmp("int", ev) ? "int" : "reboot")); |
462 | 460 | ||
463 | out: | 461 | out: |