From patchwork Tue Jul 12 10:02:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andi Shyti X-Patchwork-Id: 9224937 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 AC1D0608A1 for ; Tue, 12 Jul 2016 10:02:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9CDA727CF9 for ; Tue, 12 Jul 2016 10:02:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 90CB627F7A; Tue, 12 Jul 2016 10:02:47 +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.9 required=2.0 tests=BAYES_00,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 0D56D27F7F for ; Tue, 12 Jul 2016 10:02:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932521AbcGLKCo (ORCPT ); Tue, 12 Jul 2016 06:02:44 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:36028 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932514AbcGLKCh (ORCPT ); Tue, 12 Jul 2016 06:02:37 -0400 Received: from epcpsbgr1.samsung.com (u141.gpu120.samsung.co.kr [203.254.230.141]) by mailout4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OA7029PS582C450@mailout4.samsung.com>; Tue, 12 Jul 2016 19:02:26 +0900 (KST) Received: from epcpsbgm1new.samsung.com ( [172.20.52.113]) by epcpsbgr1.samsung.com (EPCPMTA) with SMTP id 51.E5.05174.230C4875; Tue, 12 Jul 2016 19:02:26 +0900 (KST) X-AuditID: cbfee68d-f79876d000001436-8d-5784c032d52e Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id 22.9C.02101.130C4875; Tue, 12 Jul 2016 19:02:26 +0900 (KST) Received: from samsunx.samsung ([10.113.63.54]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OA7009HH57YEU50@mmp2.samsung.com>; Tue, 12 Jul 2016 19:02:25 +0900 (KST) From: Andi Shyti To: Rob Herring , Mark Rutland , Kukjin Kim , Krzysztof Kozlowski , Mark Brown , Sylwester Nawrocki , Tomasz Figa , Michael Turquette , Stephen Boyd Cc: Chanwoo Choi , Jaehoon Chung , linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-spi@vger.kernel.org, Andi Shyti , Andi Shyti Subject: [PATCH v3 3/7] spi: s3c64xx: rename goto labels to meaningful names Date: Tue, 12 Jul 2016 19:02:12 +0900 Message-id: <1468317736-18841-4-git-send-email-andi.shyti@samsung.com> X-Mailer: git-send-email 2.8.1 In-reply-to: <1468317736-18841-1-git-send-email-andi.shyti@samsung.com> References: <1468317736-18841-1-git-send-email-andi.shyti@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrKIsWRmVeSWpSXmKPExsWyRsSkUNfoQEu4wcRbAhbbjzxjtVj84zmT xdSHT9gsrn95zmox/8g5Vosbv9pYLV6/MLTof/ya2WLT42usFh977rFazDi/j8mi8eNNdoul 1y8yWVw85WrRuvcIu8XhN+2sFj/OdLNYrNr1h9FByGPNvDWMHu9vtLJ7XO7rZfK4vuQTs8fO WXfZPTat6mTz2Lyk3qNvyypGj8+b5AI4o7hsUlJzMstSi/TtErgyNi4/yVLQK12x4s4RxgbG 16Jd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8ygVSxCWhKNN3+AVYlIvCMSeJDw2tGEIdZYDuTxLGna1lBqoQFfCTePeln BrFZBFQl5lx6B9TBwcEr4Cbx9FgsxDo5icvTH4Ct5hRwl5jcuhJsgRBQybzXO1gnMPIuYGRY xSiRWpBcUJyUnmuYl1quV5yYW1yal66XnJ+7iREc38+kdjAe3OV+iFGAg1GJh3dBSUu4EGti WXFl7iFGCQ5mJRHeK3uBQrwpiZVVqUX58UWlOanFhxhNge6ayCwlmpwPTD15JfGGxiZmRpZG 5oYWRsbmSuK8j/+vCxMSSE8sSc1OTS1ILYLpY+LglGpgVC7MvvFo7T+znVI5UqkvTF4GCu08 elzT4825rNcuakyNZ1ykv1od2iESvIPTX+z6rBVRmxpKl7rqndvneXpL2tzgV+9Z7JiUXrb4 PUx8N+daxul1JRvCFk/7z6q0reb5DRshnqOKoYtn8TRo73bcGLF7qvN/3/BPq1+wtP/2/cOy +dRWFaOJk5VYijMSDbWYi4oTAcnxSyoFAwAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The goto labels of the style of err4: err3: err2: err1: are complex to insert in between new errors without renaming all the goto statements. Replace the errX naming style to meaningful names in order to make it easier to insert new goto exit points. Signed-off-by: Andi Shyti Reviewed-by: Krzysztof Kozlowski Reviewed-by: Michael Turquette --- drivers/spi/spi-s3c64xx.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 6f2e91a..0784a4d 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -1071,7 +1071,7 @@ static int s3c64xx_spi_probe(struct platform_device *pdev) if (ret < 0) { dev_err(&pdev->dev, "failed to get alias id, errno %d\n", ret); - goto err0; + goto err_deref_master; } sdd->port_id = ret; } else { @@ -1109,13 +1109,13 @@ static int s3c64xx_spi_probe(struct platform_device *pdev) sdd->regs = devm_ioremap_resource(&pdev->dev, mem_res); if (IS_ERR(sdd->regs)) { ret = PTR_ERR(sdd->regs); - goto err0; + goto err_deref_master; } if (sci->cfg_gpio && sci->cfg_gpio()) { dev_err(&pdev->dev, "Unable to config gpio\n"); ret = -EBUSY; - goto err0; + goto err_deref_master; } /* Setup clocks */ @@ -1123,13 +1123,13 @@ static int s3c64xx_spi_probe(struct platform_device *pdev) if (IS_ERR(sdd->clk)) { dev_err(&pdev->dev, "Unable to acquire clock 'spi'\n"); ret = PTR_ERR(sdd->clk); - goto err0; + goto err_deref_master; } if (clk_prepare_enable(sdd->clk)) { dev_err(&pdev->dev, "Couldn't enable clock 'spi'\n"); ret = -EBUSY; - goto err0; + goto err_deref_master; } sprintf(clk_name, "spi_busclk%d", sci->src_clk_nr); @@ -1138,13 +1138,13 @@ static int s3c64xx_spi_probe(struct platform_device *pdev) dev_err(&pdev->dev, "Unable to acquire clock '%s'\n", clk_name); ret = PTR_ERR(sdd->src_clk); - goto err2; + goto err_disable_clk; } if (clk_prepare_enable(sdd->src_clk)) { dev_err(&pdev->dev, "Couldn't enable clock '%s'\n", clk_name); ret = -EBUSY; - goto err2; + goto err_disable_clk; } pm_runtime_set_autosuspend_delay(&pdev->dev, AUTOSUSPEND_TIMEOUT); @@ -1164,7 +1164,7 @@ static int s3c64xx_spi_probe(struct platform_device *pdev) if (ret != 0) { dev_err(&pdev->dev, "Failed to request IRQ %d: %d\n", irq, ret); - goto err3; + goto err_pm_put; } writel(S3C64XX_SPI_INT_RX_OVERRUN_EN | S3C64XX_SPI_INT_RX_UNDERRUN_EN | @@ -1174,7 +1174,7 @@ static int s3c64xx_spi_probe(struct platform_device *pdev) ret = devm_spi_register_master(&pdev->dev, master); if (ret != 0) { dev_err(&pdev->dev, "cannot register SPI master: %d\n", ret); - goto err3; + goto err_pm_put; } dev_dbg(&pdev->dev, "Samsung SoC SPI Driver loaded for Bus SPI-%d with %d Slaves attached\n", @@ -1188,15 +1188,15 @@ static int s3c64xx_spi_probe(struct platform_device *pdev) return 0; -err3: +err_pm_put: pm_runtime_put_noidle(&pdev->dev); pm_runtime_disable(&pdev->dev); pm_runtime_set_suspended(&pdev->dev); clk_disable_unprepare(sdd->src_clk); -err2: +err_disable_clk: clk_disable_unprepare(sdd->clk); -err0: +err_deref_master: spi_master_put(master); return ret;