Skip to content

Commit f4ff959

Browse files
committed
media: usb: usbtv: Stop direct calls to queue num_buffers field
jira LE-3428 Rebuild_History Non-Buildable kernel-5.14.0-570.23.1.el9_6 commit-author Benjamin Gaignard <[email protected]> commit 4545ca5 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 <[email protected]> Reviewed-by: Andrzej Pietrasiewicz <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]> (cherry picked from commit 4545ca5) Signed-off-by: Jonathan Maple <[email protected]>
1 parent 9558211 commit f4ff959

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/media/usb/usbtv/usbtv-video.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -726,9 +726,10 @@ static int usbtv_queue_setup(struct vb2_queue *vq,
726726
{
727727
struct usbtv *usbtv = vb2_get_drv_priv(vq);
728728
unsigned size = USBTV_CHUNK * usbtv->n_chunks * 2 * sizeof(u32);
729+
unsigned int q_num_bufs = vb2_get_num_buffers(vq);
729730

730-
if (vq->num_buffers + *nbuffers < 2)
731-
*nbuffers = 2 - vq->num_buffers;
731+
if (q_num_bufs + *nbuffers < 2)
732+
*nbuffers = 2 - q_num_bufs;
732733
if (*nplanes)
733734
return sizes[0] < size ? -EINVAL : 0;
734735
*nplanes = 1;

0 commit comments

Comments
 (0)