Commit 26087650 authored by Philipp Zabel's avatar Philipp Zabel Committed by Mauro Carvalho Chehab

media: coda: jpeg: improve header parse error message

If JPEG header parsing fails, output a single message instead of two
messages that say the same thing.
Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent d2cc715a
...@@ -2000,12 +2000,8 @@ static int coda_start_streaming(struct vb2_queue *q, unsigned int count) ...@@ -2000,12 +2000,8 @@ static int coda_start_streaming(struct vb2_queue *q, unsigned int count)
if (q_data_src->fourcc == V4L2_PIX_FMT_JPEG) { if (q_data_src->fourcc == V4L2_PIX_FMT_JPEG) {
buf = v4l2_m2m_next_src_buf(ctx->fh.m2m_ctx); buf = v4l2_m2m_next_src_buf(ctx->fh.m2m_ctx);
ret = coda_jpeg_decode_header(ctx, &buf->vb2_buf); ret = coda_jpeg_decode_header(ctx, &buf->vb2_buf);
if (ret < 0) { if (ret < 0)
v4l2_err(v4l2_dev,
"failed to decode JPEG header: %d\n",
ret);
goto err; goto err;
}
q_data_dst = get_q_data(ctx, V4L2_BUF_TYPE_VIDEO_CAPTURE); q_data_dst = get_q_data(ctx, V4L2_BUF_TYPE_VIDEO_CAPTURE);
q_data_dst->width = round_up(q_data_src->width, 16); q_data_dst->width = round_up(q_data_src->width, 16);
......
...@@ -283,7 +283,8 @@ int coda_jpeg_decode_header(struct coda_ctx *ctx, struct vb2_buffer *vb) ...@@ -283,7 +283,8 @@ int coda_jpeg_decode_header(struct coda_ctx *ctx, struct vb2_buffer *vb)
ret = v4l2_jpeg_parse_header(buf, len, &header); ret = v4l2_jpeg_parse_header(buf, len, &header);
if (ret < 0) { if (ret < 0) {
v4l2_err(&dev->v4l2_dev, "failed to parse header\n"); v4l2_err(&dev->v4l2_dev, "failed to parse JPEG header: %pe\n",
ERR_PTR(ret));
return ret; return ret;
} }
...@@ -1349,9 +1350,6 @@ static int coda9_jpeg_prepare_decode(struct coda_ctx *ctx) ...@@ -1349,9 +1350,6 @@ static int coda9_jpeg_prepare_decode(struct coda_ctx *ctx)
ret = coda_jpeg_decode_header(ctx, &src_buf->vb2_buf); ret = coda_jpeg_decode_header(ctx, &src_buf->vb2_buf);
if (ret < 0) { if (ret < 0) {
v4l2_err(&dev->v4l2_dev, "failed to decode JPEG header: %d\n",
ret);
src_buf = v4l2_m2m_src_buf_remove(ctx->fh.m2m_ctx); src_buf = v4l2_m2m_src_buf_remove(ctx->fh.m2m_ctx);
dst_buf = v4l2_m2m_dst_buf_remove(ctx->fh.m2m_ctx); dst_buf = v4l2_m2m_dst_buf_remove(ctx->fh.m2m_ctx);
v4l2_m2m_buf_done(src_buf, VB2_BUF_STATE_DONE); v4l2_m2m_buf_done(src_buf, VB2_BUF_STATE_DONE);
......
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