media: s5p-mfc: use printk_ratelimited for reporting ioctl errors
authorMarek Szyprowski <m.szyprowski@samsung.com>
Thu, 28 Jul 2016 10:01:54 +0000 (12:01 +0200)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Thu, 4 Aug 2016 04:31:51 +0000 (13:31 +0900)
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: Ieff41f18447d59924b2cad3b27e50dbb8e36539d

drivers/media/platform/s5p-mfc/s5p_mfc_debug.h
drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
drivers/media/platform/s5p-mfc/s5p_mfc_enc.c

index 5936923..1936a5b 100644 (file)
@@ -39,6 +39,12 @@ extern int mfc_debug_level;
                       __func__, __LINE__, ##args);     \
        } while (0)
 
+#define mfc_err_limited(fmt, args...)                  \
+       do {                                            \
+               printk_ratelimited(KERN_ERR "%s:%d: " fmt,      \
+                      __func__, __LINE__, ##args);     \
+       } while (0)
+
 #define mfc_info(fmt, args...)                         \
        do {                                            \
                printk(KERN_INFO "%s:%d: " fmt,         \
index 1828e83..fefa040 100644 (file)
@@ -660,7 +660,7 @@ static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *buf)
        int ret;
 
        if (ctx->state == MFCINST_ERROR) {
-               mfc_err("Call on DQBUF after unrecoverable error\n");
+               mfc_err_limited("Call on DQBUF after unrecoverable error\n");
                return -EIO;
        }
 
index c45f66c..1b9e64c 100644 (file)
@@ -1260,7 +1260,7 @@ static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *buf)
        int ret;
 
        if (ctx->state == MFCINST_ERROR) {
-               mfc_err("Call on DQBUF after unrecoverable error\n");
+               mfc_err_limited("Call on DQBUF after unrecoverable error\n");
                return -EIO;
        }
        if (buf->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) {