diff options
Diffstat (limited to 'drivers/media/usb/usbtv')
-rw-r--r-- | drivers/media/usb/usbtv/usbtv-video.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/media/usb/usbtv/usbtv-video.c b/drivers/media/usb/usbtv/usbtv-video.c index e645c9df2d94..05cbd2f4b445 100644 --- a/drivers/media/usb/usbtv/usbtv-video.c +++ b/drivers/media/usb/usbtv/usbtv-video.c @@ -599,19 +599,18 @@ static struct v4l2_file_operations usbtv_fops = { }; static int usbtv_queue_setup(struct vb2_queue *vq, - const void *parg, unsigned int *nbuffers, + unsigned int *nbuffers, unsigned int *nplanes, unsigned int sizes[], void *alloc_ctxs[]) { - const struct v4l2_format *fmt = parg; struct usbtv *usbtv = vb2_get_drv_priv(vq); unsigned size = USBTV_CHUNK * usbtv->n_chunks * 2 * sizeof(u32); if (vq->num_buffers + *nbuffers < 2) *nbuffers = 2 - vq->num_buffers; + if (*nplanes) + return sizes[0] < size ? -EINVAL : 0; *nplanes = 1; - if (fmt && fmt->fmt.pix.sizeimage < size) - return -EINVAL; - sizes[0] = fmt ? fmt->fmt.pix.sizeimage : size; + sizes[0] = size; return 0; } |