Commit 53963fb1 authored by Benjamin Gaignard's avatar Benjamin Gaignard Committed by Mauro Carvalho Chehab
Browse files

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: default avatarBenjamin Gaignard <benjamin.gaignard@collabora.com>
Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
CC: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 202de2b5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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) {