diff options
Diffstat (limited to 'drivers/input/touchscreen/sur40.c')
-rw-r--r-- | drivers/input/touchscreen/sur40.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/input/touchscreen/sur40.c b/drivers/input/touchscreen/sur40.c index 8ddb3f7d30..ae3aab4283 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; @@ -1123,7 +1124,7 @@ static const struct vb2_queue sur40_queue = { .ops = &sur40_queue_ops, .mem_ops = &vb2_dma_sg_memops, .timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC, - .min_buffers_needed = 3, + .min_queued_buffers = 3, }; static const struct v4l2_file_operations sur40_video_fops = { |