From 27c766aaacb265d625dc634bf7903f7f9fd0c697 Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Wed, 15 Feb 2012 15:06:19 -0800 Subject: watchdog: Use pr_ and pr_ 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 Signed-off-by: Wim Van Sebroeck --- drivers/watchdog/eurotechwdt.c | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) (limited to 'drivers/watchdog/eurotechwdt.c') 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 @@ * of the on-board SUPER I/O device SMSC FDC 37B782. */ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + #include #include #include @@ -144,11 +146,11 @@ static void eurwdt_activate_timer(void) /* Setting interrupt line */ if (irq == 2 || irq > 15 || irq < 0) { - printk(KERN_ERR ": invalid irq number\n"); + pr_err("invalid irq number\n"); irq = 0; /* if invalid we disable interrupt */ } if (irq == 0) - printk(KERN_INFO ": interrupt disabled\n"); + pr_info("interrupt disabled\n"); eurwdt_write_reg(WDT_TIMER_CFG, irq << 4); @@ -163,12 +165,12 @@ static void eurwdt_activate_timer(void) static irqreturn_t eurwdt_interrupt(int irq, void *dev_id) { - printk(KERN_CRIT "timeout WDT timeout\n"); + pr_crit("timeout WDT timeout\n"); #ifdef ONLY_TESTING - printk(KERN_CRIT "Would Reboot.\n"); + pr_crit("Would Reboot\n"); #else - printk(KERN_CRIT "Initiating system reboot.\n"); + pr_crit("Initiating system reboot\n"); emergency_restart(); #endif return IRQ_HANDLED; @@ -335,8 +337,7 @@ static int eurwdt_release(struct inode *inode, struct file *file) if (eur_expect_close == 42) eurwdt_disable_timer(); else { - printk(KERN_CRIT - "eurwdt: Unexpected close, not stopping watchdog!\n"); + pr_crit("Unexpected close, not stopping watchdog!\n"); eurwdt_ping(); } clear_bit(0, &eurwdt_is_open); @@ -429,35 +430,32 @@ static int __init eurwdt_init(void) ret = request_irq(irq, eurwdt_interrupt, 0, "eurwdt", NULL); if (ret) { - printk(KERN_ERR "eurwdt: IRQ %d is not free.\n", irq); + pr_err("IRQ %d is not free\n", irq); goto out; } if (!request_region(io, 2, "eurwdt")) { - printk(KERN_ERR "eurwdt: IO %X is not free.\n", io); + pr_err("IO %X is not free\n", io); ret = -EBUSY; goto outirq; } ret = register_reboot_notifier(&eurwdt_notifier); if (ret) { - printk(KERN_ERR - "eurwdt: can't register reboot notifier (err=%d)\n", ret); + pr_err("can't register reboot notifier (err=%d)\n", ret); goto outreg; } ret = misc_register(&eurwdt_miscdev); if (ret) { - printk(KERN_ERR "eurwdt: can't misc_register on minor=%d\n", - WATCHDOG_MINOR); + pr_err("can't misc_register on minor=%d\n", WATCHDOG_MINOR); goto outreboot; } eurwdt_unlock_chip(); ret = 0; - printk(KERN_INFO "Eurotech WDT driver 0.01 at %X (Interrupt %d)" - " - timeout event: %s\n", + pr_info("Eurotech WDT driver 0.01 at %X (Interrupt %d) - timeout event: %s\n", io, irq, (!strcmp("int", ev) ? "int" : "reboot")); out: -- cgit