watchdog: Use pr_<fmt> and pr_<level>
[sfrench/cifs-2.6.git] / drivers / watchdog / rc32434_wdt.c
index bf7bc8aa1c016fee830d5a1cbb2c6d949fa948ff..76c9d1cf8cf13aa9f5149b5c1fde7026fde074d0 100644 (file)
@@ -17,6 +17,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/module.h>              /* For module specific items */
 #include <linux/moduleparam.h>         /* For new moduleparam's */
 #include <linux/types.h>               /* For standard types (like size_t) */
@@ -33,8 +35,6 @@
 
 #include <asm/mach-rc32434/integ.h>    /* For the Watchdog registers */
 
-#define PFX KBUILD_MODNAME ": "
-
 #define VERSION "1.0"
 
 static struct {
@@ -78,8 +78,7 @@ static int rc32434_wdt_set(int new_timeout)
        int max_to = WTCOMP2SEC((u32)-1);
 
        if (new_timeout < 0 || new_timeout > max_to) {
-               printk(KERN_ERR PFX "timeout value must be between 0 and %d",
-                       max_to);
+               pr_err("timeout value must be between 0 and %d\n", max_to);
                return -EINVAL;
        }
        timeout = new_timeout;
@@ -119,7 +118,7 @@ static void rc32434_wdt_start(void)
        SET_BITS(wdt_reg->wtc, or, nand);
 
        spin_unlock(&rc32434_wdt_device.io_lock);
-       printk(KERN_INFO PFX "Started watchdog timer.\n");
+       pr_info("Started watchdog timer\n");
 }
 
 static void rc32434_wdt_stop(void)
@@ -130,7 +129,7 @@ static void rc32434_wdt_stop(void)
        SET_BITS(wdt_reg->wtc, 0, 1 << RC32434_WTC_EN);
 
        spin_unlock(&rc32434_wdt_device.io_lock);
-       printk(KERN_INFO PFX "Stopped watchdog timer.\n");
+       pr_info("Stopped watchdog timer\n");
 }
 
 static void rc32434_wdt_ping(void)
@@ -160,8 +159,7 @@ static int rc32434_wdt_release(struct inode *inode, struct file *file)
                rc32434_wdt_stop();
                module_put(THIS_MODULE);
        } else {
-               printk(KERN_CRIT PFX
-                       "device closed unexpectedly. WDT will not stop!\n");
+               pr_crit("device closed unexpectedly. WDT will not stop!\n");
                rc32434_wdt_ping();
        }
        clear_bit(0, &rc32434_wdt_device.inuse);
@@ -262,9 +260,6 @@ static struct miscdevice rc32434_wdt_miscdev = {
        .fops   = &rc32434_wdt_fops,
 };
 
-static char banner[] __devinitdata = KERN_INFO PFX
-               "Watchdog Timer version " VERSION ", timer margin: %d sec\n";
-
 static int __devinit rc32434_wdt_probe(struct platform_device *pdev)
 {
        int ret;
@@ -272,13 +267,13 @@ static int __devinit rc32434_wdt_probe(struct platform_device *pdev)
 
        r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "rb532_wdt_res");
        if (!r) {
-               printk(KERN_ERR PFX "failed to retrieve resources\n");
+               pr_err("failed to retrieve resources\n");
                return -ENODEV;
        }
 
        wdt_reg = ioremap_nocache(r->start, resource_size(r));
        if (!wdt_reg) {
-               printk(KERN_ERR PFX "failed to remap I/O resources\n");
+               pr_err("failed to remap I/O resources\n");
                return -ENXIO;
        }
 
@@ -291,18 +286,18 @@ static int __devinit rc32434_wdt_probe(struct platform_device *pdev)
         * if not reset to the default */
        if (rc32434_wdt_set(timeout)) {
                rc32434_wdt_set(WATCHDOG_TIMEOUT);
-               printk(KERN_INFO PFX
-                       "timeout value must be between 0 and %d\n",
+               pr_info("timeout value must be between 0 and %d\n",
                        WTCOMP2SEC((u32)-1));
        }
 
        ret = misc_register(&rc32434_wdt_miscdev);
        if (ret < 0) {
-               printk(KERN_ERR PFX "failed to register watchdog device\n");
+               pr_err("failed to register watchdog device\n");
                goto unmap;
        }
 
-       printk(banner, timeout);
+       pr_info("Watchdog Timer version " VERSION ", timer margin: %d sec\n",
+               timeout);
 
        return 0;