Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp541345imm; Mon, 21 May 2018 10:03:22 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqY1jcpjamCKcBFh2V34zluqiU3jz1aY9alxqAFWf88Ma5pnF0Gxjq9oB5ZHBb/8/BX95qM X-Received: by 2002:a17:902:323:: with SMTP id 32-v6mr21762448pld.312.1526922202046; Mon, 21 May 2018 10:03:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526922202; cv=none; d=google.com; s=arc-20160816; b=hbZ4Vhz2rmK2YGI6NsP/MgQgnUW/iJLRxLbgEgh27Smh9eCjUoZ8XpfKhslxXoTmr4 22Voinq4yJaNj0bMfC9dvSr866OyPknoo+Ghe8Pg+aWkjN2WxRKCb8iRocziJl2z+4O9 itw/Aj53oRY3xMzvAtwGQk9442WkCvGs0HYz4pVRa3vpa3mErkKpAwWqB1rPLkcVTdmt ieFRUYrvXoWW5l63WFdULBlRbH8r53RcxyuAtBJcFFQ2jofjHWNpaPmmYL5Egou1FN/h zFazK+D+02I5eUNPOGcz4+REqekCZb0uNl9S21aO1YiK4xS9k/P3sLUUiMADtdIMSnTl Cgkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=TLIrnX/YzPqxEckVoXUj0olN/8Gw18dyL/yO7diHHqE=; b=Z4bMQen0Ah0zrARoSu/8zb6vVNsL/RzRJT3tABFpqvmly4tlu6FJf7AUO8mxRjH2RF /Vyi+H168Bca1GZaqImjQxgu4nY6/m60dkOxJnpTNMCfNgr+JLuy/DZcRcv2YDN8OYgj nbga0N0q89DaAzzBzNfGaeqZJ62/PVQUk3CJLrLtnbg8GsJdfmM5YM2Q6b6A7kSZ9n5s eyoFgk/OTDbh1GKswl44fh8uZhUB7ZqylFcWD04VsXc0LmkqKcxZfQaBRHoZrzr+5iGK bhSsZy80FGmDgyRWJ4CVqxt8ewrBkki/2vgU5E9hu4OCbz/zenaEgmv8hYthKTXT67GE HL1Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w12-v6si14244636pld.46.2018.05.21.10.03.07; Mon, 21 May 2018 10:03:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753341AbeEURBz (ORCPT + 99 others); Mon, 21 May 2018 13:01:55 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:44334 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753082AbeEURBt (ORCPT ); Mon, 21 May 2018 13:01:49 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: ezequiel) with ESMTPSA id 24FBF2785B6 From: Ezequiel Garcia To: linux-media@vger.kernel.org Cc: kernel@collabora.com, Hans Verkuil , Mauro Carvalho Chehab , Shuah Khan , Pawel Osciak , Alexandre Courbot , Sakari Ailus , Brian Starkey , linux-kernel@vger.kernel.org, Gustavo Padovan , Ezequiel Garcia Subject: [PATCH v10 05/16] vb2: move vb2_ops functions to videobuf2-core.[ch] Date: Mon, 21 May 2018 13:59:35 -0300 Message-Id: <20180521165946.11778-6-ezequiel@collabora.com> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180521165946.11778-1-ezequiel@collabora.com> References: <20180521165946.11778-1-ezequiel@collabora.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Gustavo Padovan vb2_ops_wait_prepare() and vb2_ops_wait_finish() were in the wrong file. Signed-off-by: Gustavo Padovan --- drivers/media/common/videobuf2/videobuf2-core.c | 14 ++++++++++++++ drivers/media/common/videobuf2/videobuf2-v4l2.c | 14 -------------- include/media/videobuf2-core.h | 18 ++++++++++++++++++ include/media/videobuf2-v4l2.h | 18 ------------------ 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/drivers/media/common/videobuf2/videobuf2-core.c b/drivers/media/common/videobuf2/videobuf2-core.c index f1feb45c1e37..61e7b6407586 100644 --- a/drivers/media/common/videobuf2/videobuf2-core.c +++ b/drivers/media/common/videobuf2/videobuf2-core.c @@ -677,6 +677,20 @@ int vb2_verify_memory_type(struct vb2_queue *q, } EXPORT_SYMBOL(vb2_verify_memory_type); +/* vb2_ops helpers. Only use if vq->lock is non-NULL. */ + +void vb2_ops_wait_prepare(struct vb2_queue *vq) +{ + mutex_unlock(vq->lock); +} +EXPORT_SYMBOL_GPL(vb2_ops_wait_prepare); + +void vb2_ops_wait_finish(struct vb2_queue *vq) +{ + mutex_lock(vq->lock); +} +EXPORT_SYMBOL_GPL(vb2_ops_wait_finish); + int vb2_core_reqbufs(struct vb2_queue *q, enum vb2_memory memory, unsigned int *count) { diff --git a/drivers/media/common/videobuf2/videobuf2-v4l2.c b/drivers/media/common/videobuf2/videobuf2-v4l2.c index 886a2d8d5c6c..64503615d00b 100644 --- a/drivers/media/common/videobuf2/videobuf2-v4l2.c +++ b/drivers/media/common/videobuf2/videobuf2-v4l2.c @@ -947,20 +947,6 @@ unsigned long vb2_fop_get_unmapped_area(struct file *file, unsigned long addr, EXPORT_SYMBOL_GPL(vb2_fop_get_unmapped_area); #endif -/* vb2_ops helpers. Only use if vq->lock is non-NULL. */ - -void vb2_ops_wait_prepare(struct vb2_queue *vq) -{ - mutex_unlock(vq->lock); -} -EXPORT_SYMBOL_GPL(vb2_ops_wait_prepare); - -void vb2_ops_wait_finish(struct vb2_queue *vq) -{ - mutex_lock(vq->lock); -} -EXPORT_SYMBOL_GPL(vb2_ops_wait_finish); - MODULE_DESCRIPTION("Driver helper framework for Video for Linux 2"); MODULE_AUTHOR("Pawel Osciak , Marek Szyprowski"); MODULE_LICENSE("GPL"); diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h index baa4632c7e59..137f72702101 100644 --- a/include/media/videobuf2-core.h +++ b/include/media/videobuf2-core.h @@ -403,6 +403,24 @@ struct vb2_ops { void (*buf_queue)(struct vb2_buffer *vb); }; +/** + * vb2_ops_wait_prepare - helper function to lock a struct &vb2_queue + * + * @vq: pointer to &struct vb2_queue + * + * ..note:: only use if vq->lock is non-NULL. + */ +void vb2_ops_wait_prepare(struct vb2_queue *vq); + +/** + * vb2_ops_wait_finish - helper function to unlock a struct &vb2_queue + * + * @vq: pointer to &struct vb2_queue + * + * ..note:: only use if vq->lock is non-NULL. + */ +void vb2_ops_wait_finish(struct vb2_queue *vq); + /** * struct vb2_buf_ops - driver-specific callbacks. * diff --git a/include/media/videobuf2-v4l2.h b/include/media/videobuf2-v4l2.h index 3d5e2d739f05..cf83b01dc44e 100644 --- a/include/media/videobuf2-v4l2.h +++ b/include/media/videobuf2-v4l2.h @@ -273,22 +273,4 @@ unsigned long vb2_fop_get_unmapped_area(struct file *file, unsigned long addr, unsigned long len, unsigned long pgoff, unsigned long flags); #endif -/** - * vb2_ops_wait_prepare - helper function to lock a struct &vb2_queue - * - * @vq: pointer to &struct vb2_queue - * - * ..note:: only use if vq->lock is non-NULL. - */ -void vb2_ops_wait_prepare(struct vb2_queue *vq); - -/** - * vb2_ops_wait_finish - helper function to unlock a struct &vb2_queue - * - * @vq: pointer to &struct vb2_queue - * - * ..note:: only use if vq->lock is non-NULL. - */ -void vb2_ops_wait_finish(struct vb2_queue *vq); - #endif /* _MEDIA_VIDEOBUF2_V4L2_H */ -- 2.16.3