media: atomisp: Stop direct calls to queue num_buffers field
Use vb2_get_num_buffers() to avoid using queue num_buffers field directly. This allows us to change how the number of buffers is computed in the future. Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> CC: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
This commit is contained in:
committed by
Mauro Carvalho Chehab
parent
202de2b5d1
commit
53963fb12f
@@ -1028,7 +1028,7 @@ static int atomisp_qbuf_wrapper(struct file *file, void *fh, struct v4l2_buffer
|
||||
struct atomisp_device *isp = video_get_drvdata(vdev);
|
||||
struct atomisp_video_pipe *pipe = atomisp_to_video_pipe(vdev);
|
||||
|
||||
if (buf->index >= vdev->queue->num_buffers)
|
||||
if (buf->index >= vb2_get_num_buffers(vdev->queue))
|
||||
return -EINVAL;
|
||||
|
||||
if (buf->reserved2 & ATOMISP_BUFFER_HAS_PER_FRAME_SETTING) {
|
||||
|
||||
Reference in New Issue
Block a user