From patchwork Fri Jul 8 12:18:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andi Shyti X-Patchwork-Id: 9220731 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 296F56089D for ; Fri, 8 Jul 2016 12:18:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1A4A628745 for ; Fri, 8 Jul 2016 12:18:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0EC3228747; Fri, 8 Jul 2016 12:18:42 +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 AB08628746 for ; Fri, 8 Jul 2016 12:18:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754574AbcGHMSk (ORCPT ); Fri, 8 Jul 2016 08:18:40 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:33109 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754736AbcGHMSe (ORCPT ); Fri, 8 Jul 2016 08:18:34 -0400 Received: from epcpsbgr1.samsung.com (u141.gpu120.samsung.co.kr [203.254.230.141]) by mailout2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O9Z00CX5WUVM0C0@mailout2.samsung.com>; Fri, 08 Jul 2016 21:18:31 +0900 (KST) Received: from epcpsbgm2new.samsung.com ( [172.20.52.112]) by epcpsbgr1.samsung.com (EPCPMTA) with SMTP id DA.D9.05174.71A9F775; Fri, 8 Jul 2016 21:18:31 +0900 (KST) X-AuditID: cbfee68d-f79876d000001436-4d-577f9a17294b Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id 73.7E.04429.71A9F775; Fri, 8 Jul 2016 05:18:31 -0700 (MST) Received: from samsunx.samsung ([10.113.63.54]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O9Z00KBAWUSMU50@mmp1.samsung.com>; Fri, 08 Jul 2016 21:18:31 +0900 (KST) From: Andi Shyti To: Mark Brown Cc: Sylwester Nawrocki , Kukjin Kim , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, Andi Shyti , Andi Shyti Subject: [PATCH 1/4] spi: s3c64xx: rename goto labels to meaningful names Date: Fri, 08 Jul 2016 21:18:21 +0900 Message-id: <1467980304-14093-2-git-send-email-andi.shyti@samsung.com> X-Mailer: git-send-email 2.8.1 In-reply-to: <1467980304-14093-1-git-send-email-andi.shyti@samsung.com> References: <1467980304-14093-1-git-send-email-andi.shyti@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrOLMWRmVeSWpSXmKPExsWyRsSkQFd8Vn24QfNvLYvtR56xWiz+8ZzJ YurDJ2wWr18YWvQ/fs1ssenxNVaLy7vmsFnMOL+PyaLx4012i8Nv2lkduDyuL/nE7LFpVSeb x+Yl9R59W1YxenzeJBfAGsVlk5Kak1mWWqRvl8CV8bPzGmvBHKmK9lmLmBsYW0S7GDk5JARM JGbun8UMYYtJXLi3nq2LkYtDSGAFo8TmJVsZYYp+rL7DCmILCSxllLgwxRrC/sgoceSiHojN JqAp0XT7BxuILSKgLHH1+14WkEHMAqeZJJadfwO2QVjAU2LbyndgNouAqsS1aZuAhnJw8A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1OJDjKZAd01klhJNzgfGf15JvKGxiZmRpZG5oYWRsbmSOO/j/+vC hATSE0tSs1NTC1KLYPqYODilGhgdhZpDyqfzmgey5iaGZl2/H8zV1OQje8ny7jSpS7MvpS3Y PPEDd7egHuf+zWufNGYnnrZ5+rQyr4xjZkVt9tll6T90ZXt3pgqn/pi6eHVsNhfv6urmfVMW yR1N/tiqrP255m2sUoG11TMzRZ0Yr2jHg/fYGoy9N8lP/Pj38f6XO1Nu7szhP6rEUpyRaKjF XFScCADonj74xwIAAA== 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 In goto labels of the style of err4: err3: err2: err1: is complex to insert in between new errors without renaming all the goto statments. Replace the errX naming style to meaningful names in order to make it easier to insert new goto exit ponts. 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..2ab42b2 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_power_off; } 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_power_off; } 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_power_off: 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;