From patchwork Mon Jun 20 12:47:24 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: 9187363 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 15D0160871 for ; Mon, 20 Jun 2016 13:01:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0224E2787D for ; Mon, 20 Jun 2016 13:01:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E8F9027D13; Mon, 20 Jun 2016 13:01:54 +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 479832787D for ; Mon, 20 Jun 2016 13:01:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752974AbcFTNAq (ORCPT ); Mon, 20 Jun 2016 09:00:46 -0400 Received: from mail-lf0-f68.google.com ([209.85.215.68]:34012 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752609AbcFTNAT (ORCPT ); Mon, 20 Jun 2016 09:00:19 -0400 Received: by mail-lf0-f68.google.com with SMTP id l184so5396075lfl.1; Mon, 20 Jun 2016 06:00:18 -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=IDBHmQDc+rQk5BewaA0TDVAZpormy3pMivz70ywrR4A=; b=rXfnBGpB7R091L9Qa+KF/ERNcceuXDoLZBe6NYDEQzR6V+S/Kyy56cNQp7BR6gBAjl mJP5bpTjgfdFBbIR24t2yPl1ZW48F4YxkgR99r4UV7uKiUQ7BcW4UqALVD2hR6pn2WR/ PiAELlZtxtecFq0Q4+DQY0nBVVD0V+myAycL6/FvBnNSUKh8eKTXDXAe8Wv+6q0Eu43C w65wPjotOtFo3wD8s81jXSm1Mgk+Lzmp9a+yAExtFxXBJsYtFbUSAsWyNVw/MV0ijVEQ ZQU9f6bUCNQL3S0c/Vh42NjeQk6xol/lhkRjxHECmLKGxQ64pjarepz1pidPluNBmgXk Sz6Q== 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=IDBHmQDc+rQk5BewaA0TDVAZpormy3pMivz70ywrR4A=; b=C+dPE9d3XD4uzNh9RS4JdjPgVHbiiAxm6qA/WJRs9rNHDHGTfMXwdWUsncZhtUJ6Kb oyc6IwYYYixGL+mEe0PgAqLu1SomyPgnGHXuzI/5slMJbHsxXYfWfvGg343peaj/P6DO HEoGuhDRQb77kvBwHYcYS+HWl/dHeX/JP4fEP47ok5/vA4NbhVmEIpHcvcw+IjtsubON M/23XGFO2Sx9AXKPi7jNw5ys8o5wWp5YqJD6G3KlzM3RigNaFJGyPb9jv9G1W5lk2vw4 Ep5RF6oPqMHD3XXU7+fq7PSSkOZyPUuD01gxToyJi01zlfpWz/ToQt4Rd4GZu3d3hmiX ennQ== X-Gm-Message-State: ALyK8tJXaKyyPr3GYRHQoqPv1fB6PTeyoAXuMVbUutkjBI47obtKzSsz9YvvcB2QF8jXYg== X-Received: by 10.25.158.79 with SMTP id h76mr4805890lfe.152.1466426855046; Mon, 20 Jun 2016 05:47:35 -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 o7sm3661031lfg.45.2016.06.20.05.47.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Jun 2016 05:47:32 -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 v3 3/4] vb2: Merge vb2_internal_qbuf and vb2_qbuf Date: Mon, 20 Jun 2016 14:47:24 +0200 Message-Id: <1466426845-25673-3-git-send-email-ricardo.ribalda@gmail.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1466426845-25673-1-git-send-email-ricardo.ribalda@gmail.com> References: <1466426845-25673-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 7dff2b688a9f..9cfbb6e4bc28 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);