From patchwork Thu Jan 10 02:05:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jingoo Han X-Patchwork-Id: 1958351 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 8E45A40232 for ; Thu, 10 Jan 2013 02:06:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758045Ab3AJCGA (ORCPT ); Wed, 9 Jan 2013 21:06:00 -0500 Received: from mailout4.samsung.com ([203.254.224.34]:28372 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758024Ab3AJCGA (ORCPT ); Wed, 9 Jan 2013 21:06:00 -0500 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MGE00D940HCTOI0@mailout4.samsung.com> for linux-mmc@vger.kernel.org; Thu, 10 Jan 2013 11:05:59 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [203.254.230.48]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 76.01.01231.6022EE05; Thu, 10 Jan 2013 11:05:58 +0900 (KST) X-AuditID: cbfee61a-b7fa66d0000004cf-96-50ee2206daba Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 16.01.01231.6022EE05; Thu, 10 Jan 2013 11:05:58 +0900 (KST) Received: from DOJG1HAN02 ([12.23.120.99]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MGE0069A0HYXN10@mmp1.samsung.com> for linux-mmc@vger.kernel.org; Thu, 10 Jan 2013 11:05:58 +0900 (KST) From: Jingoo Han To: 'Chris Ball' Cc: linux-mmc@vger.kernel.org, 'Ben Dooks' , 'Jingoo Han' References: In-reply-to: Subject: [PATCH v2] mmc: sdhci-s3c: Use devm_clk_get() Date: Thu, 10 Jan 2013 11:05:58 +0900 Message-id: <007601cdeed7$082d53a0$1887fae0$%han@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-index: Ac3uDqjViXxUOesDQyCXL6lDlpZX9AAyFGFg Content-language: ko DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrCIsWRmVeSWpSXmKPExsVy+t8zA102pXcBBrPPm1oc+d/P6MDo8XmT XABjFJdNSmpOZllqkb5dAldG48RZLAVnBStaW2MaGE/wdTFyckgImEhMOH2PBcIWk7hwbz1b FyMXh5DAMkaJplfbmGGKlryZCZVYxCjRvGonM4Qzg0ni6c9usHY2ATWJL18Os4PYIgKKElu+ HwezmQXSJL69+cbaxcgB1MAtsbo5CCTMKcAjse5PJ9gCYQEziY/7dzCC2CwCqhI/z+wHG8kr YCvRfOAblC0o8WMyxKXMAloS63ceZ4Kw5SU2r3nLDDJeQkBd4tFfXRBTRMBIYt+vaIgKEYl9 L95BTReQ+Db5EAtEtazEpgNgj0gILGKXmLd2PTQcJCUOrrjBMoFRYhaSxbOQLJ6FZPEsJCsW MLKsYhRNLUguKE5KzzXUK07MLS7NS9dLzs/dxAiJKqkdjCsbLA4xCnAwKvHwWs58EyDEmlhW XJl7iFGCg1lJhDdk+9sAId6UxMqq1KL8+KLSnNTiQ4w+QJdPZJYSTc4HRnxeSbyhsbGJmYmp ibmlqbkpDmElcV7GU08ChATSE0tSs1NTC1KLYMYxcXBKNTDanv4XHP1Gy+6nTpm0ZgTb9kA3 V/tTIlML1+ZvS+Fik3uzItnqT7+pgvssqUcFfSseOwZMi1svXPvt8A71wy8+vdjX79SieFkl ctOfsyfbIufnry0+faxr6sTjp7Uuzg6JPlwzoW3TVce+ZJnvO1szY8QyuI+FF+/isZLNSK9Z dU6dS2/uZXUlluKMREMt5qLiRABuTjCX1wIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrMIsWRmVeSWpSXmKPExsVy+t9jAV02pXcBBie/Glgc+d/P6MDo8XmT XABjVAOjTUZqYkpqkUJqXnJ+SmZeuq2Sd3C8c7ypmYGhrqGlhbmSQl5ibqqtkotPgK5bZg7Q VCWFssScUqBQQGJxsZK+HaYJoSFuuhYwjRG6viFBcD1GBmggYR1jRuPEWSwFZwUrWltjGhhP 8HUxcnJICJhILHkzkw3CFpO4cG89kM3FISSwiFGiedVOZghnBpPE05/dLCBVbAJqEl++HGYH sUUEFCW2fD8OZjMLpEl8e/ONtYuRA6iBW2J1cxBImFOAR2Ldn05mEFtYwEzi4/4djCA2i4Cq xM8z+8FG8grYSjQf+AZlC0r8mHyPBWKklsT6nceZIGx5ic1r3jKDjJcQUJd49FcXxBQRMJLY 9ysaokJEYt+Ld4wTGIVmIRk0C8mgWUgGzULSsoCRZRWjaGpBckFxUnquoV5xYm5xaV66XnJ+ 7iZGcMw+k9rBuLLB4hCjAAejEg+v5cw3AUKsiWXFlbmHGCU4mJVEeEO2vw0Q4k1JrKxKLcqP LyrNSS0+xOgD9OdEZinR5HxgOskriTc0NjEzsjQyszAyMTfHIawkzst46kmAkEB6Yklqdmpq QWoRzDgmDk6pBkYzx2X2yWx8WZl3j31eeOtl35RewZ/5mTPrn64RPmwh0sNpLpX/vuplhZaQ 6h212i2h05t102++MXjLc3tlegZjtKiMkK75A38ftalrf+3bPtsgQ5Pvq/8Ba4+b92dUO2lP dtfKmPD9gMOTScZvne4/7k348r03z2/9t7SdMwV5fjvz/zs+a5oSS3FGoqEWc1FxIgDcBgH/ BgMAAA== X-CFilter-Loop: Reflected Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org Use devm_clk_get() rather than clk_get() to make cleanup paths more simple. Signed-off-by: Jingoo Han --- Changes since v1: - modified the commit message drivers/mmc/host/sdhci-s3c.c | 17 ++--------------- 1 files changed, 2 insertions(+), 15 deletions(-) diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c index 82a8de1..5aaef5b 100644 --- a/drivers/mmc/host/sdhci-s3c.c +++ b/drivers/mmc/host/sdhci-s3c.c @@ -608,7 +608,7 @@ static int sdhci_s3c_probe(struct platform_device *pdev) platform_set_drvdata(pdev, host); - sc->clk_io = clk_get(dev, "hsmmc"); + sc->clk_io = devm_clk_get(dev, "hsmmc"); if (IS_ERR(sc->clk_io)) { dev_err(dev, "failed to get io clock\n"); ret = PTR_ERR(sc->clk_io); @@ -623,7 +623,7 @@ static int sdhci_s3c_probe(struct platform_device *pdev) char name[14]; snprintf(name, 14, "mmc_busclk.%d", ptr); - clk = clk_get(dev, name); + clk = devm_clk_get(dev, name); if (IS_ERR(clk)) continue; @@ -765,15 +765,9 @@ static int sdhci_s3c_probe(struct platform_device *pdev) #ifndef CONFIG_PM_RUNTIME clk_disable_unprepare(sc->clk_bus[sc->cur_clk]); #endif - for (ptr = 0; ptr < MAX_BUS_CLK; ptr++) { - if (sc->clk_bus[ptr]) { - clk_put(sc->clk_bus[ptr]); - } - } err_no_busclks: clk_disable_unprepare(sc->clk_io); - clk_put(sc->clk_io); err_pdata_io_clk: sdhci_free_host(host); @@ -786,7 +780,6 @@ static int sdhci_s3c_remove(struct platform_device *pdev) struct sdhci_host *host = platform_get_drvdata(pdev); struct sdhci_s3c *sc = sdhci_priv(host); struct s3c_sdhci_platdata *pdata = sc->pdata; - int ptr; if (pdata->cd_type == S3C_SDHCI_CD_EXTERNAL && pdata->ext_cd_cleanup) pdata->ext_cd_cleanup(&sdhci_s3c_notify_change); @@ -806,13 +799,7 @@ static int sdhci_s3c_remove(struct platform_device *pdev) #ifndef CONFIG_PM_RUNTIME clk_disable_unprepare(sc->clk_bus[sc->cur_clk]); #endif - for (ptr = 0; ptr < MAX_BUS_CLK; ptr++) { - if (sc->clk_bus[ptr]) { - clk_put(sc->clk_bus[ptr]); - } - } clk_disable_unprepare(sc->clk_io); - clk_put(sc->clk_io); sdhci_free_host(host); platform_set_drvdata(pdev, NULL);