drm/nouveau/bios: allow loading alternate vbios image as firmware
[GitHub/LineageOS/android_kernel_samsung_universal7580.git] / drivers / watchdog / machzwd.c
index b536111d53bf750a9fe02f7e92462961d24711d3..bf84f788e59261f985ce85dce2a6fade949807e9 100644 (file)
@@ -28,6 +28,8 @@
  *      Added nowayout module option to override CONFIG_WATCHDOG_NOWAYOUT
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/types.h>
@@ -92,8 +94,8 @@ MODULE_DESCRIPTION("MachZ ZF-Logic Watchdog driver");
 MODULE_LICENSE("GPL");
 MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
 
-static int nowayout = WATCHDOG_NOWAYOUT;
-module_param(nowayout, int, 0);
+static bool nowayout = WATCHDOG_NOWAYOUT;
+module_param(nowayout, bool, 0);
 MODULE_PARM_DESC(nowayout,
                "Watchdog cannot be stopped once started (default="
                                __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
@@ -140,10 +142,10 @@ static unsigned long next_heartbeat;
 #define ZF_CTIMEOUT 0xffff
 
 #ifndef ZF_DEBUG
-#      define dprintk(format, args...)
+#define dprintk(format, args...)
 #else
-#      define dprintk(format, args...) printk(KERN_DEBUG PFX \
-                               ":%s:%d: " format, __func__, __LINE__ , ## args)
+#define dprintk(format, args...)                                       \
+       pr_debug(":%s:%d: " format, __func__, __LINE__ , ## args)
 #endif
 
 
@@ -202,7 +204,7 @@ static void zf_timer_off(void)
        zf_set_control(ctrl_reg);
        spin_unlock_irqrestore(&zf_port_lock, flags);
 
-       printk(KERN_INFO PFX ": Watchdog timer is now disabled\n");
+       pr_info("Watchdog timer is now disabled\n");
 }
 
 
@@ -232,7 +234,7 @@ static void zf_timer_on(void)
        zf_set_control(ctrl_reg);
        spin_unlock_irqrestore(&zf_port_lock, flags);
 
-       printk(KERN_INFO PFX ": Watchdog timer is now enabled\n");
+       pr_info("Watchdog timer is now enabled\n");
 }
 
 
@@ -262,7 +264,7 @@ static void zf_ping(unsigned long data)
 
                mod_timer(&zf_timer, jiffies + ZF_HW_TIMEO);
        } else
-               printk(KERN_CRIT PFX ": I will reset your machine\n");
+               pr_crit("I will reset your machine\n");
 }
 
 static ssize_t zf_write(struct file *file, const char __user *buf, size_t count,
@@ -341,8 +343,7 @@ static int zf_close(struct inode *inode, struct file *file)
                zf_timer_off();
        else {
                del_timer(&zf_timer);
-               printk(KERN_ERR PFX ": device file closed unexpectedly. "
-                                               "Will not stop the WDT!\n");
+               pr_err("device file closed unexpectedly. Will not stop the WDT!\n");
        }
        clear_bit(0, &zf_is_open);
        zf_expect_close = 0;
@@ -389,19 +390,18 @@ static void __init zf_show_action(int act)
 {
        static const char * const str[] = { "RESET", "SMI", "NMI", "SCI" };
 
-       printk(KERN_INFO PFX ": Watchdog using action = %s\n", str[act]);
+       pr_info("Watchdog using action = %s\n", str[act]);
 }
 
 static int __init zf_init(void)
 {
        int ret;
 
-       printk(KERN_INFO PFX
-               ": MachZ ZF-Logic Watchdog driver initializing.\n");
+       pr_info("MachZ ZF-Logic Watchdog driver initializing\n");
 
        ret = zf_get_ZFL_version();
        if (!ret || ret == 0xffff) {
-               printk(KERN_WARNING PFX ": no ZF-Logic found\n");
+               pr_warn("no ZF-Logic found\n");
                return -ENODEV;
        }
 
@@ -413,23 +413,20 @@ static int __init zf_init(void)
        zf_show_action(action);
 
        if (!request_region(ZF_IOBASE, 3, "MachZ ZFL WDT")) {
-               printk(KERN_ERR "cannot reserve I/O ports at %d\n",
-                                                       ZF_IOBASE);
+               pr_err("cannot reserve I/O ports at %d\n", ZF_IOBASE);
                ret = -EBUSY;
                goto no_region;
        }
 
        ret = register_reboot_notifier(&zf_notifier);
        if (ret) {
-               printk(KERN_ERR "can't register reboot notifier (err=%d)\n",
-                                                                       ret);
+               pr_err("can't register reboot notifier (err=%d)\n", ret);
                goto no_reboot;
        }
 
        ret = misc_register(&zf_miscdev);
        if (ret) {
-               printk(KERN_ERR "can't misc_register on minor=%d\n",
-                                                       WATCHDOG_MINOR);
+               pr_err("can't misc_register on minor=%d\n", WATCHDOG_MINOR);
                goto no_misc;
        }