From patchwork Fri Nov 9 17:05:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 10676351 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B9E3613AD for ; Fri, 9 Nov 2018 17:05:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A37382E492 for ; Fri, 9 Nov 2018 17:05:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 978382F018; Fri, 9 Nov 2018 17:05:48 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 35E262E4D1 for ; Fri, 9 Nov 2018 17:05:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728548AbeKJCrN (ORCPT ); Fri, 9 Nov 2018 21:47:13 -0500 Received: from perceval.ideasonboard.com ([213.167.242.64]:38888 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728532AbeKJCrN (ORCPT ); Fri, 9 Nov 2018 21:47:13 -0500 Received: from localhost.localdomain (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 559641590; Fri, 9 Nov 2018 18:05:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1541783143; bh=S20zW1StUje7D27qwTczq7wCqrNm8JiT93aiLozLmBg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:In-Reply-To: References:From; b=Be44iqM/oPt3JaMMltOcixeYj1fiMXkvkVk63eA3c+sw3fKC50Uh/13jXS4naTKC0 ynFuwRdl9H03M92YKI/oR3bZhWwRMt/e09Mkoyr8FAbHRbaD7b48rAUIiEx2//Q1rJ EEZ/hjOQw7UGbMm78Dn1Tdcg5F21sOhh0zahmzbU= From: Kieran Bingham To: Laurent Pinchart , linux-media@vger.kernel.org Cc: Guennadi Liakhovetski , Olivier BRAUN , Troy Kisky , Randy Dunlap , Philipp Zabel , Ezequiel Garcia , Kieran Bingham , Tomasz Figa , Keiichi Watanabe Subject: [PATCH v6 09/10] media: uvcvideo: Rename uvc_{un,}init_video() Date: Fri, 9 Nov 2018 17:05:32 +0000 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: 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 We have both uvc_init_video() and uvc_video_init() calls which can be quite confusing to determine the process for each. Now that video uvc_video_enable() has been renamed to uvc_video_start_streaming(), adapt these calls to suit the new flow. Rename uvc_init_video() to uvc_video_start() and uvc_uninit_video() to uvc_video_stop(). Signed-off-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- v6: - Append _transfer to {_stop,_start} drivers/media/usb/uvc/uvc_video.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c index cd67506dc696..a81012c65280 100644 --- a/drivers/media/usb/uvc/uvc_video.c +++ b/drivers/media/usb/uvc/uvc_video.c @@ -1641,7 +1641,8 @@ static int uvc_alloc_urb_buffers(struct uvc_streaming *stream, /* * Uninitialize isochronous/bulk URBs and free transfer buffers. */ -static void uvc_uninit_video(struct uvc_streaming *stream, int free_buffers) +static void uvc_video_stop_transfer(struct uvc_streaming *stream, + int free_buffers) { struct uvc_urb *uvc_urb; @@ -1718,7 +1719,7 @@ static int uvc_init_video_isoc(struct uvc_streaming *stream, urb = usb_alloc_urb(npackets, gfp_flags); if (urb == NULL) { - uvc_uninit_video(stream, 1); + uvc_video_stop_transfer(stream, 1); return -ENOMEM; } @@ -1786,7 +1787,7 @@ static int uvc_init_video_bulk(struct uvc_streaming *stream, urb = usb_alloc_urb(0, gfp_flags); if (urb == NULL) { - uvc_uninit_video(stream, 1); + uvc_video_stop_transfer(stream, 1); return -ENOMEM; } @@ -1806,7 +1807,8 @@ static int uvc_init_video_bulk(struct uvc_streaming *stream, /* * Initialize isochronous/bulk URBs and allocate transfer buffers. */ -static int uvc_init_video(struct uvc_streaming *stream, gfp_t gfp_flags) +static int uvc_video_start_transfer(struct uvc_streaming *stream, + gfp_t gfp_flags) { struct usb_interface *intf = stream->intf; struct usb_host_endpoint *ep; @@ -1894,7 +1896,7 @@ static int uvc_init_video(struct uvc_streaming *stream, gfp_t gfp_flags) if (ret < 0) { uvc_printk(KERN_ERR, "Failed to submit URB %u " "(%d).\n", i, ret); - uvc_uninit_video(stream, 1); + uvc_video_stop_transfer(stream, 1); return ret; } } @@ -1925,7 +1927,7 @@ int uvc_video_suspend(struct uvc_streaming *stream) return 0; stream->frozen = 1; - uvc_uninit_video(stream, 0); + uvc_video_stop_transfer(stream, 0); usb_set_interface(stream->dev->udev, stream->intfnum, 0); return 0; } @@ -1961,7 +1963,7 @@ int uvc_video_resume(struct uvc_streaming *stream, int reset) if (ret < 0) return ret; - return uvc_init_video(stream, GFP_NOIO); + return uvc_video_start_transfer(stream, GFP_NOIO); } /* ------------------------------------------------------------------------ @@ -2089,7 +2091,7 @@ int uvc_video_start_streaming(struct uvc_streaming *stream) if (ret < 0) goto error_commit; - ret = uvc_init_video(stream, GFP_KERNEL); + ret = uvc_video_start_transfer(stream, GFP_KERNEL); if (ret < 0) goto error_video; @@ -2105,7 +2107,7 @@ int uvc_video_start_streaming(struct uvc_streaming *stream) int uvc_video_stop_streaming(struct uvc_streaming *stream) { - uvc_uninit_video(stream, 1); + uvc_video_stop_transfer(stream, 1); if (stream->intf->num_altsetting > 1) { usb_set_interface(stream->dev->udev, stream->intfnum, 0);