aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/videobuf2-core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/videobuf2-core.c')
-rw-r--r--drivers/media/video/videobuf2-core.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/media/video/videobuf2-core.c b/drivers/media/video/videobuf2-core.c
index 6ba1461d51e..3015e600094 100644
--- a/drivers/media/video/videobuf2-core.c
+++ b/drivers/media/video/videobuf2-core.c
@@ -492,13 +492,6 @@ int vb2_reqbufs(struct vb2_queue *q, struct v4l2_requestbuffers *req)
492 return -EINVAL; 492 return -EINVAL;
493 } 493 }
494 494
495 /*
496 * If the same number of buffers and memory access method is requested
497 * then return immediately.
498 */
499 if (q->memory == req->memory && req->count == q->num_buffers)
500 return 0;
501
502 if (req->count == 0 || q->num_buffers != 0 || q->memory != req->memory) { 495 if (req->count == 0 || q->num_buffers != 0 || q->memory != req->memory) {
503 /* 496 /*
504 * We already have buffers allocated, so first check if they 497 * We already have buffers allocated, so first check if they
@@ -539,9 +532,9 @@ int vb2_reqbufs(struct vb2_queue *q, struct v4l2_requestbuffers *req)
539 /* Finally, allocate buffers and video memory */ 532 /* Finally, allocate buffers and video memory */
540 ret = __vb2_queue_alloc(q, req->memory, num_buffers, num_planes, 533 ret = __vb2_queue_alloc(q, req->memory, num_buffers, num_planes,
541 plane_sizes); 534 plane_sizes);
542 if (ret < 0) { 535 if (ret == 0) {
543 dprintk(1, "Memory allocation failed with error: %d\n", ret); 536 dprintk(1, "Memory allocation failed\n");
544 return ret; 537 return -ENOMEM;
545 } 538 }
546 539
547 /* 540 /*
@@ -1196,6 +1189,7 @@ static void __vb2_queue_cancel(struct vb2_queue *q)
1196 * has not already dequeued before initiating cancel. 1189 * has not already dequeued before initiating cancel.
1197 */ 1190 */
1198 INIT_LIST_HEAD(&q->done_list); 1191 INIT_LIST_HEAD(&q->done_list);
1192 atomic_set(&q->queued_count, 0);
1199 wake_up_all(&q->done_wq); 1193 wake_up_all(&q->done_wq);
1200 1194
1201 /* 1195 /*