Commit 0a79ef33 authored by Marek Szyprowski's avatar Marek Szyprowski Committed by Mauro Carvalho Chehab

[media] s5p-mfc: Use printk_ratelimited for reporting ioctl errors

Some applications don't check error codes from QBUF/DQBUF ioctls,
so don't spam kernel log with errors if they fall into endless loop
trying to queue next buffer after a failure.
Signed-off-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 3605163d
...@@ -39,6 +39,12 @@ extern int mfc_debug_level; ...@@ -39,6 +39,12 @@ extern int mfc_debug_level;
__func__, __LINE__, ##args); \ __func__, __LINE__, ##args); \
} while (0) } 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...) \ #define mfc_info(fmt, args...) \
do { \ do { \
printk(KERN_INFO "%s:%d: " fmt, \ printk(KERN_INFO "%s:%d: " fmt, \
......
...@@ -642,7 +642,7 @@ static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *buf) ...@@ -642,7 +642,7 @@ static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *buf)
int ret; int ret;
if (ctx->state == MFCINST_ERROR) { 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; return -EIO;
} }
......
...@@ -1268,7 +1268,7 @@ static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *buf) ...@@ -1268,7 +1268,7 @@ static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *buf)
int ret; int ret;
if (ctx->state == MFCINST_ERROR) { 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; return -EIO;
} }
if (buf->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { if (buf->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment