This is an automatic generated email to let you know that the following patch 
were queued:

Subject: media: touchscreen: sur40: Stop direct calls to queue num_buffers field
Author:  Benjamin Gaignard <[email protected]>
Date:    Thu Nov 9 17:34:49 2023 +0100

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]>
Acked-by: Dmitry Torokhov <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>

 drivers/input/touchscreen/sur40.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

---

diff --git a/drivers/input/touchscreen/sur40.c 
b/drivers/input/touchscreen/sur40.c
index 8ddb3f7d307a..e7d2a52169a0 100644
--- a/drivers/input/touchscreen/sur40.c
+++ b/drivers/input/touchscreen/sur40.c
@@ -847,9 +847,10 @@ static int sur40_queue_setup(struct vb2_queue *q,
                       unsigned int sizes[], struct device *alloc_devs[])
 {
        struct sur40_state *sur40 = vb2_get_drv_priv(q);
+       unsigned int q_num_bufs = vb2_get_num_buffers(q);
 
-       if (q->num_buffers + *nbuffers < 3)
-               *nbuffers = 3 - q->num_buffers;
+       if (q_num_bufs + *nbuffers < 3)
+               *nbuffers = 3 - q_num_bufs;
 
        if (*nplanes)
                return sizes[0] < sur40->pix_fmt.sizeimage ? -EINVAL : 0;

_______________________________________________
linuxtv-commits mailing list
[email protected]
https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to