]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
media: hantro: Use vb2_get_buffer
authorEzequiel Garcia <ezequiel@collabora.com>
Tue, 18 Jun 2019 23:12:37 +0000 (19:12 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Mon, 24 Jun 2019 18:59:30 +0000 (14:59 -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/staging/media/hantro/hantro_drv.c

index 1d3af881d088a8260121c2a9cfafa60102caa31e..c3665f0e87a275ee2100cb5a2b97867bb33f8a12 100644 (file)
@@ -45,12 +45,14 @@ void *hantro_get_ctrl(struct hantro_ctx *ctx, u32 id)
 
 dma_addr_t hantro_get_ref(struct vb2_queue *q, u64 ts)
 {
+       struct vb2_buffer *buf;
        int index;
 
        index = vb2_find_timestamp(q, ts, 0);
-       if (index >= 0)
-               return vb2_dma_contig_plane_dma_addr(q->bufs[index], 0);
-       return 0;
+       if (index < 0)
+               return 0;
+       buf = vb2_get_buffer(q, index);
+       return vb2_dma_contig_plane_dma_addr(buf, 0);
 }
 
 static int