]> git.karo-electronics.de Git - linux-beck.git/commitdiff
drivers/tty: use printk_ratelimited() instead of printk_ratelimit()
authorManuel Zerpies <manuel.f.zerpies@ww.stud.uni-erlangen.de>
Thu, 16 Jun 2011 12:07:22 +0000 (14:07 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 1 Jul 2011 22:35:45 +0000 (15:35 -0700)
Since the printk_ratelimit() shouldn't be used anymore (see comment in
include/linux/printk.h), replace it with printk_ratelimited().

Signed-off-by: Manuel Zerpies <manuel.f.zerpies@ww.stud.uni-erlangen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/tty/moxa.c
drivers/tty/mxser.c
drivers/tty/tty_io.c

index ba679ce0a77456b1ecbeb6e674b67fbbb4ab1dac..d15a071b1a54c54099a9e17cc67f6f4837e8a68c 100644 (file)
@@ -44,6 +44,7 @@
 #include <linux/init.h>
 #include <linux/bitops.h>
 #include <linux/slab.h>
+#include <linux/ratelimit.h>
 
 #include <asm/system.h>
 #include <asm/io.h>
@@ -242,8 +243,8 @@ static void moxa_wait_finish(void __iomem *ofsAddr)
        while (readw(ofsAddr + FuncCode) != 0)
                if (time_after(jiffies, end))
                        return;
-       if (readw(ofsAddr + FuncCode) != 0 && printk_ratelimit())
-               printk(KERN_WARNING "moxa function expired\n");
+       if (readw(ofsAddr + FuncCode) != 0)
+               printk_ratelimited(KERN_WARNING "moxa function expired\n");
 }
 
 static void moxafunc(void __iomem *ofsAddr, u16 cmd, u16 arg)
index d188f378684dfc695dfe724d839a259ca73fd644..7fc8c02fea6c89c709cf29be18351ea83aeb3495 100644 (file)
@@ -39,6 +39,7 @@
 #include <linux/pci.h>
 #include <linux/bitops.h>
 #include <linux/slab.h>
+#include <linux/ratelimit.h>
 
 #include <asm/system.h>
 #include <asm/io.h>
@@ -1490,8 +1491,7 @@ static int mxser_ioctl_special(unsigned int cmd, void __user *argp)
 
        switch (cmd) {
        case MOXA_GET_MAJOR:
-               if (printk_ratelimit())
-                       printk(KERN_WARNING "mxser: '%s' uses deprecated ioctl "
+               printk_ratelimited(KERN_WARNING "mxser: '%s' uses deprecated ioctl "
                                        "%x (GET_MAJOR), fix your userspace\n",
                                        current->comm, cmd);
                return put_user(ttymajor, (int __user *)argp);
index 6556f7452ba6f960a9f083068f1674164c93ff11..150e4f747c7dc4bc822a706a76d06afefb80424d 100644 (file)
@@ -94,6 +94,7 @@
 #include <linux/delay.h>
 #include <linux/seq_file.h>
 #include <linux/serial.h>
+#include <linux/ratelimit.h>
 
 #include <linux/uaccess.h>
 #include <asm/system.h>
@@ -1420,8 +1421,7 @@ err_module_put:
 
        /* call the tty release_tty routine to clean out this slot */
 err_release_tty:
-       if (printk_ratelimit())
-               printk(KERN_INFO "tty_init_dev: ldisc open failed, "
+       printk_ratelimited(KERN_INFO "tty_init_dev: ldisc open failed, "
                                 "clearing slot %d\n", idx);
        release_tty(tty, idx);
        return ERR_PTR(retval);