[media] uvcvideo: Remove duplicate check for number of buffers in queue_setup
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Tue, 18 Feb 2014 13:02:50 +0000 (10:02 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Fri, 28 Feb 2014 16:22:27 +0000 (13:22 -0300)
videobuf2 already ensures that the number of buffers will not exceed
VIDEO_MAX_FRAME, which is equal to our arbitraty limit of
UVC_MAX_VIDEO_BUFFERS. Remove the duplicate check.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/usb/uvc/uvc_queue.c
drivers/media/usb/uvc/uvcvideo.h

index cd962be860ca3ac14d87dfca467cce021cfa8f4f..254bc346243e9af93a1483f3762b6ca367bd3dea 100644 (file)
@@ -48,9 +48,6 @@ static int uvc_queue_setup(struct vb2_queue *vq, const struct v4l2_format *fmt,
        struct uvc_streaming *stream =
                        container_of(queue, struct uvc_streaming, queue);
 
-       if (*nbuffers > UVC_MAX_VIDEO_BUFFERS)
-               *nbuffers = UVC_MAX_VIDEO_BUFFERS;
-
        *nplanes = 1;
 
        sizes[0] = stream->ctrl.dwMaxVideoFrameSize;
index 9e35982d099af2e41ec762e1f16b36506ac5d176..61736324488bb2929abaf9bb88c9e10f3d2af429 100644 (file)
 #define UVC_URBS               5
 /* Maximum number of packets per URB. */
 #define UVC_MAX_PACKETS                32
-/* Maximum number of video buffers. */
-#define UVC_MAX_VIDEO_BUFFERS  32
 /* Maximum status buffer size in bytes of interrupt URB. */
 #define UVC_MAX_STATUS_SIZE    16