From patchwork Tue Nov 18 11:23:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 5327451 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0D3959F462 for ; Tue, 18 Nov 2014 11:24:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D414520179 for ; Tue, 18 Nov 2014 11:24:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A75DF20136 for ; Tue, 18 Nov 2014 11:24:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754276AbaKRLYS (ORCPT ); Tue, 18 Nov 2014 06:24:18 -0500 Received: from mail-wi0-f178.google.com ([209.85.212.178]:59045 "EHLO mail-wi0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754278AbaKRLYP (ORCPT ); Tue, 18 Nov 2014 06:24:15 -0500 Received: by mail-wi0-f178.google.com with SMTP id hi2so3722291wib.17 for ; Tue, 18 Nov 2014 03:24:14 -0800 (PST) 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=JSFDzxs9WX4E7bAth4eCZojAZE3Syc4hK4oN+bwuT5U=; b=olOVymTNiJx78cR3v2a/2nlF2dPGFkF76GwM0nZpWulYH/lnIDR2BliGTr7gj2++0P N7T6RSc5/IcNSjLVIuIXDLxPdyWYiYjmD46ST8oYiFJSeAiznIinqQ0RGr4ln1xe21kO SyRNMZb6i+UVbyDHZ8sk31a3bnPqAsCkxILUMugrnx4JnlT4rMMeGmdbLtawzsGjOksn 8k3d7pifIIM9lR+JzNeB1bOZ7/AheFR9K6iohunfbwiFb4Nv5YOgEHMHSyfkpWG5ytXK g2vjh4y7v6OFWAq5KEKjfTMV4EzTLN13uu2vk5oEaQBZ4ChcbkCPgjda9aKNcnkhHntJ 6U2Q== X-Received: by 10.194.157.137 with SMTP id wm9mr47271140wjb.5.1416309854115; Tue, 18 Nov 2014 03:24:14 -0800 (PST) Received: from tango-charlie.RL.local ([194.72.83.162]) by mx.google.com with ESMTPSA id cu9sm55428904wjb.0.2014.11.18.03.24.12 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 18 Nov 2014 03:24:13 -0800 (PST) From: "Lad, Prabhakar" To: Hans Verkuil , Mauro Carvalho Chehab , LMML Cc: LKML , "Lad, Prabhakar" , Laurent Pinchart Subject: [PATCH 12/12] media: usb: uvc: use vb2_ops_wait_prepare/finish helper Date: Tue, 18 Nov 2014 11:23:41 +0000 Message-Id: <1416309821-5426-13-git-send-email-prabhakar.csengg@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1416309821-5426-1-git-send-email-prabhakar.csengg@gmail.com> References: <1416309821-5426-1-git-send-email-prabhakar.csengg@gmail.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Lad, Prabhakar Cc: Laurent Pinchart --- drivers/media/usb/uvc/uvc_queue.c | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/drivers/media/usb/uvc/uvc_queue.c b/drivers/media/usb/uvc/uvc_queue.c index 6e92d20..9c42ac6f 100644 --- a/drivers/media/usb/uvc/uvc_queue.c +++ b/drivers/media/usb/uvc/uvc_queue.c @@ -117,27 +117,13 @@ static void uvc_buffer_finish(struct vb2_buffer *vb) uvc_video_clock_update(stream, &vb->v4l2_buf, buf); } -static void uvc_wait_prepare(struct vb2_queue *vq) -{ - struct uvc_video_queue *queue = vb2_get_drv_priv(vq); - - mutex_unlock(&queue->mutex); -} - -static void uvc_wait_finish(struct vb2_queue *vq) -{ - struct uvc_video_queue *queue = vb2_get_drv_priv(vq); - - mutex_lock(&queue->mutex); -} - static struct vb2_ops uvc_queue_qops = { .queue_setup = uvc_queue_setup, .buf_prepare = uvc_buffer_prepare, .buf_queue = uvc_buffer_queue, .buf_finish = uvc_buffer_finish, - .wait_prepare = uvc_wait_prepare, - .wait_finish = uvc_wait_finish, + .wait_prepare = vb2_ops_wait_prepare, + .wait_finish = vb2_ops_wait_finish, }; int uvc_queue_init(struct uvc_video_queue *queue, enum v4l2_buf_type type, @@ -153,6 +139,7 @@ int uvc_queue_init(struct uvc_video_queue *queue, enum v4l2_buf_type type, queue->queue.mem_ops = &vb2_vmalloc_memops; queue->queue.timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC | V4L2_BUF_FLAG_TSTAMP_SRC_SOE; + queue->queue.lock = &queue->mutex; ret = vb2_queue_init(&queue->queue); if (ret) return ret;