From patchwork Mon Jun 20 12:30:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda Delgado X-Patchwork-Id: 9187303 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0F58B607D1 for ; Mon, 20 Jun 2016 12:32:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ED6D127813 for ; Mon, 20 Jun 2016 12:32:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E27D02787D; Mon, 20 Jun 2016 12:32:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 85A5527813 for ; Mon, 20 Jun 2016 12:32:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752173AbcFTMcs (ORCPT ); Mon, 20 Jun 2016 08:32:48 -0400 Received: from mail-lf0-f65.google.com ([209.85.215.65]:32982 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751687AbcFTMcr (ORCPT ); Mon, 20 Jun 2016 08:32:47 -0400 Received: by mail-lf0-f65.google.com with SMTP id l188so5319029lfe.0; Mon, 20 Jun 2016 05:30:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=qOz1+9A5fIqEiSjmu4a+bFoAREZiOcoCiIaR7O6IBak=; b=wa4pi/xVhXLxJx1NyZNEaTxGx6q2ZCQXJa+i98vbM2b73TbYcqIJoLicjJwh2a0MSY 0DNf2saL10oCUsIw5RYcEQAWjFyldfblg/4KLbmY51rSC0ndOgW/FHntXyfqUjMhYP7a eWC3hw8sZC55rZOuCWhJ8NWb1Gzgqe7slmetk0nVIGYALSOCtHlSUZALrLKj/fCKzHh6 l8w1mNBQxopPGN95GAWHI0yKf/CZe5RxMI3EeiBoog+h0qw6YLDUgZjT6iljz+b8K4Gw v7NhxsS/t+uw70AZERvW2weqduwlGxxo2MctNqeb+gy/ChlxEM9hX3jr0Z0zb8RQpyF9 FSBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=qOz1+9A5fIqEiSjmu4a+bFoAREZiOcoCiIaR7O6IBak=; b=PL5hjHvwaTkc952FLvsmELB/uVoZdp5h6ZTu4oNsMIriIbOqA5VcR1oqSbl7CreDMS qz1qVRKl9vLP1mYi5eW4NFXwQcuk7bvawon2ggwD1h2SK75MCSw+637aKEIW0iJQNJ/2 xhWPzCmgrijs37jQkqTZYxaRFWgjcfMOssL/QV2TVti4m9EsLK0LbkViqnnBbXZ2Fd27 xNCOuC+wD5L+ChN6G3YgOM9tHdBLXn9u0nnEXeP5gibG+yjUKFmB64aSqHmSZPyZgN9a weNnf5dfWDz77hDCKNcdNelsBW3yxZ2zW8u+G9yNNbueBbz5TP4l1VsMomVNAwRiG1DB 6DJg== X-Gm-Message-State: ALyK8tIdE5pGoiz2LjBo9P9Il5HrZ1RZ+hUQMtNwm9Dtg7PnNgIIuLK1/fsJwqwSL1yoMA== X-Received: by 10.46.71.208 with SMTP id u199mr4007336lja.17.1466425813659; Mon, 20 Jun 2016 05:30:13 -0700 (PDT) Received: from neopili.qtec.com (cpe.xe-3-0-1-778.vbrnqe10.dk.customer.tdc.net. [80.197.57.18]) by smtp.gmail.com with ESMTPSA id u193sm4921183lfd.36.2016.06.20.05.30.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Jun 2016 05:30:12 -0700 (PDT) From: Ricardo Ribalda Delgado To: Pawel Osciak , Marek Szyprowski , Kyungmin Park , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, hans.verkuil@cisco.com, hverkuil@xs4all.nl Cc: Ricardo Ribalda Delgado Subject: [PATCH v2 2/4] vb2: Merge vb2_internal_qbuf and vb2_qbuf Date: Mon, 20 Jun 2016 14:30:07 +0200 Message-Id: <1466425809-23469-2-git-send-email-ricardo.ribalda@gmail.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1466425809-23469-1-git-send-email-ricardo.ribalda@gmail.com> References: <1466425809-23469-1-git-send-email-ricardo.ribalda@gmail.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP After all the code refactoring, vb2_internal_dqbuf is only called by vb2_dqbuf. Since the function it is very simple, there is no need to have two functions. Signed-off-by: Ricardo Ribalda Delgado --- drivers/media/v4l2-core/videobuf2-v4l2.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/media/v4l2-core/videobuf2-v4l2.c b/drivers/media/v4l2-core/videobuf2-v4l2.c index 07d8b409ce05..ba3467468e55 100644 --- a/drivers/media/v4l2-core/videobuf2-v4l2.c +++ b/drivers/media/v4l2-core/videobuf2-v4l2.c @@ -427,7 +427,7 @@ static int __fill_vb2_buffer(struct vb2_buffer *vb, if (V4L2_TYPE_IS_OUTPUT(b->type)) { /* * For output buffers mask out the timecode flag: - * this will be handled later in vb2_internal_qbuf(). + * this will be handled later in vb2_qbuf(). * The 'field' is valid metadata for this output buffer * and so that needs to be copied here. */ @@ -586,13 +586,6 @@ int vb2_create_bufs(struct vb2_queue *q, struct v4l2_create_buffers *create) } EXPORT_SYMBOL_GPL(vb2_create_bufs); -static int vb2_internal_qbuf(struct vb2_queue *q, struct v4l2_buffer *b) -{ - int ret = vb2_queue_or_prepare_buf(q, b, "qbuf"); - - return ret ? ret : vb2_core_qbuf(q, b->index, b); -} - /** * vb2_qbuf() - Queue a buffer from userspace * @q: videobuf2 queue @@ -612,12 +605,15 @@ static int vb2_internal_qbuf(struct vb2_queue *q, struct v4l2_buffer *b) */ int vb2_qbuf(struct vb2_queue *q, struct v4l2_buffer *b) { + int ret; + if (vb2_fileio_is_active(q)) { dprintk(1, "file io in progress\n"); return -EBUSY; } - return vb2_internal_qbuf(q, b); + ret = vb2_queue_or_prepare_buf(q, b, "qbuf"); + return ret ? ret : vb2_core_qbuf(q, b->index, b); } EXPORT_SYMBOL_GPL(vb2_qbuf);