From patchwork Sat Mar 25 00:05:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 9644315 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 DE14B6020B for ; Sat, 25 Mar 2017 00:17:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C463A25223 for ; Sat, 25 Mar 2017 00:17:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B50CA26E4E; Sat, 25 Mar 2017 00:17:07 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0757425223 for ; Sat, 25 Mar 2017 00:17:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=SCNg5ewtNpsrrisPKC6DJ0rcR5WTnJwLy0xqSfM6LC0=; b=I1UdQ9E+iwAqE9iLoEw6/6Hpat VQsoP6zNIrFKpsc6cUvfSCuYWB9tUk0IiMKwgG8TMW6cTyQLvesVtfgxOLFqwQehyja/99y/2ZDAZ O11lLlMRXLB+0nny0pJsTLoQn2EXhArWy08lwkPDDdahd7BAYtYAEbByndSl2tuP9I/fXs7NdSx74 34GKDjNolBwVdWjNEiOD5MkGMpKlxWOfYnLtAtmmcatkGCIE0NyvY7fYQDreQIOIGWv/HENTu1cND J52aFvsr66efib+ccqXmD0DGSOdkD260b1nmroSlB4zOoJKH+ugCYgPOPzOp1z2RF7+FWds/ARMXu wRGJ/Wvg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1crZO4-00082e-Kx; Sat, 25 Mar 2017 00:16:56 +0000 Received: from ec2-52-27-115-49.us-west-2.compute.amazonaws.com ([52.27.115.49] helo=osg.samsung.com) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1crZD4-0002h7-2l for linux-arm-kernel@lists.infradead.org; Sat, 25 Mar 2017 00:05:37 +0000 Received: from localhost (localhost [127.0.0.1]) by osg.samsung.com (Postfix) with ESMTP id C4978A05EF; Sat, 25 Mar 2017 00:05:38 +0000 (UTC) X-Virus-Scanned: amavisd-new at osg.samsung.com X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from osg.samsung.com ([127.0.0.1]) by localhost (s-opensource.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HprlXZgrzLAV; Sat, 25 Mar 2017 00:05:38 +0000 (UTC) Received: from localhost.localdomain (c-73-181-52-62.hsd1.co.comcast.net [73.181.52.62]) by osg.samsung.com (Postfix) with ESMTPSA id B2903A05EE; Sat, 25 Mar 2017 00:05:37 +0000 (UTC) From: Shuah Khan To: balbi@kernel.org, gregkh@linuxfoundation.org, kgene@kernel.org, krzk@kernel.org, javier@osg.samsung.com Subject: [PATCH 3/7] usb: dwc3: core: change goto labels to meaningful names Date: Fri, 24 Mar 2017 18:05:01 -0600 Message-Id: X-Mailer: git-send-email 2.9.3 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170324_170534_222707_CECA93E4 X-CRM114-Status: UNSURE ( 7.69 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-samsung-soc@vger.kernel.org, linux-usb@vger.kernel.org, Shuah Khan , linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Change goto labels to meaningful names. Signed-off-by: Shuah Khan --- drivers/usb/dwc3/core.c | 62 ++++++++++++++++++++++++------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 0fc7bef..f82786a 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -347,7 +347,7 @@ static int dwc3_setup_scratch_buffers(struct dwc3 *dwc) if (dma_mapping_error(dwc->sysdev, scratch_addr)) { dev_err(dwc->sysdev, "failed to map scratch buffer\n"); ret = -EFAULT; - goto err0; + goto return_err; } dwc->scratch_addr = scratch_addr; @@ -357,22 +357,22 @@ static int dwc3_setup_scratch_buffers(struct dwc3 *dwc) ret = dwc3_send_gadget_generic_command(dwc, DWC3_DGCMD_SET_SCRATCHPAD_ADDR_LO, param); if (ret < 0) - goto err1; + goto unmap_scratchbuf; param = upper_32_bits(scratch_addr); ret = dwc3_send_gadget_generic_command(dwc, DWC3_DGCMD_SET_SCRATCHPAD_ADDR_HI, param); if (ret < 0) - goto err1; + goto unmap_scratchbuf; return 0; -err1: +unmap_scratchbuf: dma_unmap_single(dwc->sysdev, dwc->scratch_addr, dwc->nr_scratch * DWC3_SCRATCHBUF_SIZE, DMA_BIDIRECTIONAL); -err0: +return_err: return ret; } @@ -669,7 +669,7 @@ static int dwc3_core_init(struct dwc3 *dwc) if (!dwc3_core_is_valid(dwc)) { dev_err(dwc->dev, "this is not a DesignWare USB3 DRD Core\n"); ret = -ENODEV; - goto err0; + goto return_err; } /* @@ -687,18 +687,18 @@ static int dwc3_core_init(struct dwc3 *dwc) ret = dwc3_core_soft_reset(dwc); if (ret) - goto err0; + goto return_err; ret = dwc3_phy_setup(dwc); if (ret) - goto err0; + goto return_err; dwc3_core_setup_global_control(dwc); dwc3_core_num_eps(dwc); ret = dwc3_setup_scratch_buffers(dwc); if (ret) - goto err1; + goto phy_shutdown_exit; /* Adjust Frame Length */ dwc3_frame_length_adjustment(dwc); @@ -707,16 +707,16 @@ static int dwc3_core_init(struct dwc3 *dwc) usb_phy_set_suspend(dwc->usb3_phy, 0); ret = phy_power_on(dwc->usb2_generic_phy); if (ret < 0) - goto err2; + goto phy_suspend; ret = phy_power_on(dwc->usb3_generic_phy); if (ret < 0) - goto err3; + goto usb2_phy_poweroff; ret = dwc3_event_buffers_setup(dwc); if (ret) { dev_err(dwc->dev, "failed to setup event buffers\n"); - goto err4; + goto usb3_phy_poweroff; } switch (dwc->dr_mode) { @@ -757,23 +757,23 @@ static int dwc3_core_init(struct dwc3 *dwc) return 0; -err4: +usb3_phy_poweroff: phy_power_off(dwc->usb3_generic_phy); -err3: +usb2_phy_poweroff: phy_power_off(dwc->usb2_generic_phy); -err2: +phy_suspend: usb_phy_set_suspend(dwc->usb2_phy, 1); usb_phy_set_suspend(dwc->usb3_phy, 1); -err1: +phy_shutdown_exit: usb_phy_shutdown(dwc->usb2_phy); usb_phy_shutdown(dwc->usb3_phy); phy_exit(dwc->usb2_generic_phy); phy_exit(dwc->usb3_generic_phy); -err0: +return_err: return ret; } @@ -1091,7 +1091,7 @@ static int dwc3_probe(struct platform_device *pdev) regs = devm_ioremap_resource(dev, res); if (IS_ERR(regs)) { ret = PTR_ERR(regs); - goto err0; + goto restore_res_start; } dwc->regs = regs; @@ -1104,7 +1104,7 @@ static int dwc3_probe(struct platform_device *pdev) ret = dwc3_core_get_phy(dwc); if (ret) - goto err0; + goto restore_res_start; spin_lock_init(&dwc->lock); @@ -1114,7 +1114,7 @@ static int dwc3_probe(struct platform_device *pdev) pm_runtime_enable(dev); ret = pm_runtime_get_sync(dev); if (ret < 0) - goto err1; + goto runtime_disable; pm_runtime_forbid(dev); @@ -1122,52 +1122,52 @@ static int dwc3_probe(struct platform_device *pdev) if (ret) { dev_err(dwc->dev, "failed to allocate event buffers\n"); ret = -ENOMEM; - goto err2; + goto runtime_allow_put_sync; } ret = dwc3_get_dr_mode(dwc); if (ret) - goto err3; + goto ulpi_exit; ret = dwc3_alloc_scratch_buffers(dwc); if (ret) - goto err3; + goto ulpi_exit; ret = dwc3_core_init(dwc); if (ret) { dev_err(dev, "failed to initialize core\n"); - goto err4; + goto free_scratchbufs; } dwc3_check_params(dwc); ret = dwc3_core_init_mode(dwc); if (ret) - goto err5; + goto event_buffers_cleanup; dwc3_debugfs_init(dwc); pm_runtime_put(dev); return 0; -err5: +event_buffers_cleanup: dwc3_event_buffers_cleanup(dwc); -err4: +free_scratchbufs: dwc3_free_scratch_buffers(dwc); -err3: +ulpi_exit: dwc3_free_event_buffers(dwc); dwc3_ulpi_exit(dwc); -err2: +runtime_allow_put_sync: pm_runtime_allow(&pdev->dev); pm_runtime_put_sync(&pdev->dev); -err1: +runtime_disable: pm_runtime_disable(&pdev->dev); -err0: +restore_res_start: /* * restore res->start back to its original value so that, in case the * probe is deferred, we don't end up getting error in request the