media: mtk-jpeg: Use vb2_get_buffer
authorEzequiel Garcia <ezequiel@collabora.com>
Mon, 10 Jun 2019 20:55:23 +0000 (16:55 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Fri, 21 Jun 2019 20:22:02 +0000 (16:22 -0400)
Use the newly introduced vb2_get_buffer API and avoid
accessing buffers in the queue directly.

Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c

index 723a233e2b5f59c5b46dd8783dd2e1d27b2721df..ee802fc3bcdfc8f365453ff4da5df616155f50ff 100644 (file)
@@ -518,7 +518,7 @@ static int mtk_jpeg_qbuf(struct file *file, void *priv, struct v4l2_buffer *buf)
                return -EINVAL;
        }
 
-       vb = vq->bufs[buf->index];
+       vb = vb2_get_buffer(vq, buf->index);
        jpeg_src_buf = mtk_jpeg_vb2_to_srcbuf(vb);
        jpeg_src_buf->flags = (buf->m.planes[0].bytesused == 0) ?
                MTK_JPEG_BUF_FLAGS_LAST_FRAME : MTK_JPEG_BUF_FLAGS_INIT;