[PATCH 2/8] usb: gadget: uvc: fix return code of REQBUFS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On success, VIDIOC_REQBUFS should return 0, not the number of allocated
buffers. As uvcg_alloc_buffers() is directly called by regbufs, it has
to return the correct error codes.

Signed-off-by: Michael Tretter <m.tretter@xxxxxxxxxxxxxx>
---
 drivers/usb/gadget/function/uvc_queue.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/usb/gadget/function/uvc_queue.c b/drivers/usb/gadget/function/uvc_queue.c
index 0aa3d7e1f3cc..f14f75b93aaa 100644
--- a/drivers/usb/gadget/function/uvc_queue.c
+++ b/drivers/usb/gadget/function/uvc_queue.c
@@ -179,11 +179,7 @@ void uvcg_free_buffers(struct uvc_video_queue *queue)
 int uvcg_alloc_buffers(struct uvc_video_queue *queue,
 			      struct v4l2_requestbuffers *rb)
 {
-	int ret;
-
-	ret = vb2_reqbufs(&queue->queue, rb);
-
-	return ret ? ret : rb->count;
+	return vb2_reqbufs(&queue->queue, rb);
 }
 
 int uvcg_query_buffer(struct uvc_video_queue *queue, struct v4l2_buffer *buf)

-- 
2.30.2



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux