watchdog: Use pr_<fmt> and pr_<level>
[firefly-linux-kernel-4.4.55.git] / drivers / watchdog / sbc_epx_c3.c
index eaca366b7234a5c1df978adcaacd73a01a66337b..1a13d36c5f126c65547e7fb62cbeaf9ee4affe50 100644 (file)
@@ -13,6 +13,8 @@
  *     based on softdog.c by Alan Cox <alan@lxorguk.ukuu.org.uk>
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/types.h>
@@ -28,7 +30,6 @@
 #include <linux/uaccess.h>
 #include <linux/io.h>
 
-#define PFX "epx_c3: "
 static int epx_c3_alive;
 
 #define WATCHDOG_TIMEOUT 1             /* 1 sec default timeout */
@@ -51,7 +52,7 @@ static void epx_c3_stop(void)
 
        outb(0, EPXC3_WATCHDOG_CTL_REG);
 
-       printk(KERN_INFO PFX "Stopped watchdog timer.\n");
+       pr_info("Stopped watchdog timer\n");
 }
 
 static void epx_c3_pet(void)
@@ -75,7 +76,7 @@ static int epx_c3_open(struct inode *inode, struct file *file)
        epx_c3_pet();
 
        epx_c3_alive = 1;
-       printk(KERN_INFO "Started watchdog timer.\n");
+       pr_info("Started watchdog timer\n");
 
        return nonseekable_open(inode, file);
 }
@@ -173,9 +174,6 @@ static struct notifier_block epx_c3_notifier = {
        .notifier_call = epx_c3_notify_sys,
 };
 
-static const char banner[] __initconst = KERN_INFO PFX
-       "Hardware Watchdog Timer for Winsystems EPX-C3 SBC: 0.1\n";
-
 static int __init watchdog_init(void)
 {
        int ret;
@@ -185,20 +183,19 @@ static int __init watchdog_init(void)
 
        ret = register_reboot_notifier(&epx_c3_notifier);
        if (ret) {
-               printk(KERN_ERR PFX "cannot register reboot notifier "
-                       "(err=%d)\n", ret);
+               pr_err("cannot register reboot notifier (err=%d)\n", ret);
                goto out;
        }
 
        ret = misc_register(&epx_c3_miscdev);
        if (ret) {
-               printk(KERN_ERR PFX "cannot register miscdev on minor=%d "
-                       "(err=%d)\n", WATCHDOG_MINOR, ret);
+               pr_err("cannot register miscdev on minor=%d (err=%d)\n",
+                      WATCHDOG_MINOR, ret);
                unregister_reboot_notifier(&epx_c3_notifier);
                goto out;
        }
 
-       printk(banner);
+       pr_info("Hardware Watchdog Timer for Winsystems EPX-C3 SBC: 0.1\n");
 
        return 0;