From patchwork Fri Jul 8 14:46:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andi Shyti X-Patchwork-Id: 9221139 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 BFDD86089D for ; Fri, 8 Jul 2016 14:47:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B0EC32885B for ; Fri, 8 Jul 2016 14:47:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A4AC82885A; Fri, 8 Jul 2016 14:47:54 +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=unavailable 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 41CC82885E for ; Fri, 8 Jul 2016 14:47:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755631AbcGHOrt (ORCPT ); Fri, 8 Jul 2016 10:47:49 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:39141 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755536AbcGHOrf (ORCPT ); Fri, 8 Jul 2016 10:47:35 -0400 Received: from epcpsbgr1.samsung.com (u141.gpu120.samsung.co.kr [203.254.230.141]) by mailout3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OA002GSM3R41100@mailout3.samsung.com>; Fri, 08 Jul 2016 23:47:28 +0900 (KST) Received: from epcpsbgm2new.samsung.com ( [172.20.52.113]) by epcpsbgr1.samsung.com (EPCPMTA) with SMTP id 7E.8D.05174.00DBF775; Fri, 8 Jul 2016 23:47:28 +0900 (KST) X-AuditID: cbfee68d-f79876d000001436-81-577fbd002900 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id 13.55.04429.00DBF775; Fri, 8 Jul 2016 07:47:28 -0700 (MST) 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 <0OA000AMT3QD1730@mmp2.samsung.com>; Fri, 08 Jul 2016 23:47:27 +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 v2 3/7] spi: s3c64xx: rename goto labels to meaningful names Date: Fri, 08 Jul 2016 23:46:37 +0900 Message-id: <1467989201-14661-4-git-send-email-andi.shyti@samsung.com> X-Mailer: git-send-email 2.8.1 In-reply-to: <1467989201-14661-1-git-send-email-andi.shyti@samsung.com> References: <1467989201-14661-1-git-send-email-andi.shyti@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrGIsWRmVeSWpSXmKPExsWyRsSkUJdhb324we07ShbbjzxjtVj84zmT xdSHT9gsrn95zmox/8g5Vosbv9pYLV6/MLTof/ya2WLT42usFh977rFazDi/j8mi8eNNdoul 1y8yWVw85WrRuvcIu8XhN+2sFj/OdLNYrNr1h9FByGPNvDWMHu9vtLJ7XO7rZfK4vuQTs8fO WXfZPTat6mTz2Lyk3qNvyypGj8+b5AI4o7hsUlJzMstSi/TtErgyZhx6zFhwWapi8YNPjA2M 20S7GDk5JAR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dPsHWEJE4BmTxIeG14wgDrPAdiaJY0/XglUJC/hIvLp1Hcxm EVCVuDDhPhuIzSvgJvHlzG6ofXISl6c/AItzCrhLHFj5CywuBFRz+e4X9gmMvAsYGVYxSqQW JBcUJ6XnGuWllusVJ+YWl+al6yXn525iBEf4M+kdjId3uR9iFOBgVOLhDairDxdiTSwrrsw9 xCjBwawkwiu2CyjEm5JYWZValB9fVJqTWnyI0RTosInMUqLJ+cDkk1cSb2hsYmZkaWRuaGFk bK4kzvv4/7owIYH0xJLU7NTUgtQimD4mDk6pBsb0tHx71dO2u6XZD3ULnrkg9uIax7Xcax3C nYVre1TttE1F/7ebH7zC06cw1VzpuV7gCpPEHVc2m/mfVk2rnbFlsmi5la/N24y7G5gN5Bxs v+6ueZL9QWLTXce6ncteF4jZf7m2wO/rpFlz2UNY1jQH7X8f+ye/b0KHt1VYTabFbPf7i+qU DyuxFGckGmoxFxUnAgB0Ee9MBgMAAA== 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 --- 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;