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: 9220749 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 AFC116044F for ; Fri, 8 Jul 2016 12:20:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A0A1428749 for ; Fri, 8 Jul 2016 12:20:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 93C6E2874A; Fri, 8 Jul 2016 12:20:43 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2925128747 for ; Fri, 8 Jul 2016 12:20:43 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bLUkJ-0001hU-Dx; Fri, 08 Jul 2016 12:19:03 +0000 Received: from mailout2.samsung.com ([203.254.224.25]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bLUkA-0001dZ-PB for linux-arm-kernel@lists.infradead.org; Fri, 08 Jul 2016 12:18:55 +0000 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> for linux-arm-kernel@lists.infradead.org; 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 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+14WkEHMAqeZJJadfwO2QVjAU2LbyndgNouAqsS1aZuAhnJw8Aq4 Scw56QyxS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hJNzgfGf15JvKGxiZmRpZG5oYWRsbmSOO/j/+vC hATSE0tSs1NTC1KLYPqYODilGhgdhZpDyqfzmgey5iaGZl2/H8zV1OQje8ny7jSpS7MvpS3Y PPEDd7egHuf+zWufNGYnnrZ5+rQyr4xjZkVt9tll6T90ZXt3pgqn/pi6eHVsNhfv6urmfVMW yR1N/tiqrP255m2sUoG11TMzRZ0Yr2jHg/fYGoy9N8lP/Pj38f6XO1Nu7szhP6rEUpyRaKjF XFScCADonj74xwIAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160708_051854_988530_C541FB77 X-CRM114-Status: GOOD ( 11.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Krzysztof Kozlowski , linux-samsung-soc@vger.kernel.org, Andi Shyti , linux-kernel@vger.kernel.org, Andi Shyti , linux-spi@vger.kernel.org, Kukjin Kim , Sylwester Nawrocki , 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 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;