summaryrefslogtreecommitdiffstats
path: root/drivers/media/common/videobuf2/videobuf2-v4l2.c
diff options
context:
space:
mode:
authorBenjamin Gaignard <benjamin.gaignard@collabora.com>2024-01-18 13:14:52 +0100
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2024-01-24 17:27:51 +0100
commit78e23c3e914a5e678a20286fb09bc218017af89a (patch)
tree4b95f66a03c5546c5647f8e58b3ab06e67d47844 /drivers/media/common/videobuf2/videobuf2-v4l2.c
parentc14d17a32568679385d32fe7a23994560c12772c (diff)
downloadlinux-stable-78e23c3e914a5e678a20286fb09bc218017af89a.tar.gz
linux-stable-78e23c3e914a5e678a20286fb09bc218017af89a.tar.bz2
linux-stable-78e23c3e914a5e678a20286fb09bc218017af89a.zip
media: media videobuf2: 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. Fixes: d055a76c0065 ("media: core: Report the maximum possible number of buffers for the queue") Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com> Acked-by: Tomasz Figa <tfiga@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'drivers/media/common/videobuf2/videobuf2-v4l2.c')
-rw-r--r--drivers/media/common/videobuf2/videobuf2-v4l2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/common/videobuf2/videobuf2-v4l2.c b/drivers/media/common/videobuf2/videobuf2-v4l2.c
index 54d572c3b515..6380155d8575 100644
--- a/drivers/media/common/videobuf2/videobuf2-v4l2.c
+++ b/drivers/media/common/videobuf2/videobuf2-v4l2.c
@@ -1029,7 +1029,7 @@ int vb2_ioctl_create_bufs(struct file *file, void *priv,
int res = vb2_verify_memory_type(vdev->queue, p->memory,
p->format.type);
- p->index = vdev->queue->num_buffers;
+ p->index = vb2_get_num_buffers(vdev->queue);
fill_buf_caps(vdev->queue, &p->capabilities);
validate_memory_flags(vdev->queue, p->memory, &p->flags);
/*