diff options
Diffstat (limited to 'drivers/media/common')
-rw-r--r-- | drivers/media/common/videobuf2/videobuf2-core.c | 18 | ||||
-rw-r--r-- | drivers/media/common/videobuf2/videobuf2-v4l2.c | 2 |
2 files changed, 9 insertions, 11 deletions
diff --git a/drivers/media/common/videobuf2/videobuf2-core.c b/drivers/media/common/videobuf2/videobuf2-core.c index cb86b02afd4a..194b9188ad3e 100644 --- a/drivers/media/common/videobuf2/videobuf2-core.c +++ b/drivers/media/common/videobuf2/videobuf2-core.c @@ -1368,23 +1368,21 @@ bool vb2_request_object_is_buffer(struct media_request_object *obj) } EXPORT_SYMBOL_GPL(vb2_request_object_is_buffer); -bool vb2_request_has_buffers(struct media_request *req) +unsigned int vb2_request_buffer_cnt(struct media_request *req) { struct media_request_object *obj; unsigned long flags; - bool has_buffers = false; + unsigned int buffer_cnt = 0; spin_lock_irqsave(&req->lock, flags); - list_for_each_entry(obj, &req->objects, list) { - if (vb2_request_object_is_buffer(obj)) { - has_buffers = true; - break; - } - } + list_for_each_entry(obj, &req->objects, list) + if (vb2_request_object_is_buffer(obj)) + buffer_cnt++; spin_unlock_irqrestore(&req->lock, flags); - return has_buffers; + + return buffer_cnt; } -EXPORT_SYMBOL_GPL(vb2_request_has_buffers); +EXPORT_SYMBOL_GPL(vb2_request_buffer_cnt); int vb2_core_prepare_buf(struct vb2_queue *q, unsigned int index, void *pb) { diff --git a/drivers/media/common/videobuf2/videobuf2-v4l2.c b/drivers/media/common/videobuf2/videobuf2-v4l2.c index 6831a2eb1859..a17033ab2c22 100644 --- a/drivers/media/common/videobuf2/videobuf2-v4l2.c +++ b/drivers/media/common/videobuf2/videobuf2-v4l2.c @@ -1139,7 +1139,7 @@ int vb2_request_validate(struct media_request *req) struct media_request_object *obj; int ret = 0; - if (!vb2_request_has_buffers(req)) + if (!vb2_request_buffer_cnt(req)) return -ENOENT; list_for_each_entry(obj, &req->objects, list) { |