diff options
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/touchscreen/sur40.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/input/touchscreen/sur40.c b/drivers/input/touchscreen/sur40.c index d214f22ed305..3f3e2b12e5e7 100644 --- a/drivers/input/touchscreen/sur40.c +++ b/drivers/input/touchscreen/sur40.c @@ -644,22 +644,21 @@ static void sur40_disconnect(struct usb_interface *interface) * minimum number: many DMA engines need a minimum of 2 buffers in the * queue and you need to have another available for userspace processing. */ -static int sur40_queue_setup(struct vb2_queue *q, const void *parg, +static int sur40_queue_setup(struct vb2_queue *q, unsigned int *nbuffers, unsigned int *nplanes, unsigned int sizes[], void *alloc_ctxs[]) { - const struct v4l2_format *fmt = parg; struct sur40_state *sur40 = vb2_get_drv_priv(q); if (q->num_buffers + *nbuffers < 3) *nbuffers = 3 - q->num_buffers; + alloc_ctxs[0] = sur40->alloc_ctx; - if (fmt && fmt->fmt.pix.sizeimage < sur40_video_format.sizeimage) - return -EINVAL; + if (*nplanes) + return sizes[0] < sur40_video_format.sizeimage ? -EINVAL : 0; *nplanes = 1; - sizes[0] = fmt ? fmt->fmt.pix.sizeimage : sur40_video_format.sizeimage; - alloc_ctxs[0] = sur40->alloc_ctx; + sizes[0] = sur40_video_format.sizeimage; return 0; } |