From patchwork Thu Mar 7 04:11:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jingoo Han X-Patchwork-Id: 2229941 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 0B4A53FCF6 for ; Thu, 7 Mar 2013 04:11:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756031Ab3CGELc (ORCPT ); Wed, 6 Mar 2013 23:11:32 -0500 Received: from mailout2.samsung.com ([203.254.224.25]:46281 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754553Ab3CGELb (ORCPT ); Wed, 6 Mar 2013 23:11:31 -0500 Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MJ9002LLVM1OJO0@mailout2.samsung.com> for linux-mmc@vger.kernel.org; Thu, 07 Mar 2013 13:11:30 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [203.254.230.48]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id A3.5D.25214.27318315; Thu, 07 Mar 2013 13:11:30 +0900 (KST) X-AuditID: cbfee68e-b7fa46d00000627e-e6-51381372f3b9 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 15.8F.03918.17318315; Thu, 07 Mar 2013 13:11:30 +0900 (KST) Received: from DOJG1HAN02 ([12.23.120.99]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MJ900KU5VN5MY30@mmp2.samsung.com>; Thu, 07 Mar 2013 13:11:29 +0900 (KST) From: Jingoo Han To: 'Chris Ball' Cc: linux-mmc@vger.kernel.org, 'Ulf Hansson' , 'Jaehoon Chung' , 'Jingoo Han' Subject: [PATCH v3] mmc: sdhci-s3c: Use devm_clk_get() Date: Thu, 07 Mar 2013 13:11:29 +0900 Message-id: <000101ce1ae9$d84cd860$88e68920$%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: Ac4a6dgGshoJD3jJSw+DgILj+wD/Ig== Content-language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrNIsWRmVeSWpSXmKPExsVy+t8zA90iYYtAg/2PuC22v97IZnF54SVW ixu/2lgtjvzvZ7Q4vjbcgdXj0JW1jB53ru1h8+jbsorR4/MmuQCWKC6blNSczLLUIn27BK6M 98vmMBb0CFesn3KVsYHxNX8XIyeHhICJxM9tvxghbDGJC/fWs3UxcnEICSxjlOjasoMNpujU hknMEInpjBIdO2azQzi/GCX6r21iBaliE1CT+PLlMDuILSKgKLHl+3GwImaBqYwSzXsPs4Ak hAXMJBZN7gWzWQRUJTb/vwC2m1fAVuL32nnsELagxI/J98BqmAW0JNbvPM4EYctLbF7zFugM DqCT1CUe/dWF2KUn8Xr1VDaIEhGJfS/eMYLslRDYxS7x6fo1JohdAhLfJh9igeiVldh0gBni M0mJgytusExgFJuFZPMsJJtnIdk8C8mKBYwsqxhFUwuSC4qT0ouM9IoTc4tL89L1kvNzNzFC Iq5vB+PNA9aHGJOB1k9klhJNzgdGbF5JvKGxsYmZiamJuaWpuSlpwkrivPKXZAKFBNITS1Kz U1MLUovii0pzUosPMTJxcEo1MAY4BxXNPHXy0yO1yTpS7lM3Hz5huUf5jvB1972yyU/uNcUw L+x8No1vzrbV+U2vL2aYhrgpvHFMtZmUof3PZbe9I9Ofsv06xt3Ga0RvuzyK3yTzWK3xxKf0 Tl/PWYVltrP8w0z2RLsdED1VpHl40ew/yqWGPJXf7j+7w5u+Ldj1TcMZhbub3imxFGckGmox FxUnAgDkDUbdzgIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprBKsWRmVeSWpSXmKPExsVy+t9jQd0iYYtAg2NdbBbbX29ks7i88BKr xY1fbawWR/73M1ocXxvuwOpx6MpaRo871/awefRtWcXo8XmTXABLVAOjTUZqYkpqkUJqXnJ+ SmZeuq2Sd3C8c7ypmYGhrqGlhbmSQl5ibqqtkotPgK5bZg7QXiWFssScUqBQQGJxsZK+HaYJ oSFuuhYwjRG6viFBcD1GBmggYR1jxvtlcxgLeoQr1k+5ytjA+Jq/i5GTQ0LAROLUhknMELaY xIV769m6GLk4hASmM0p07JjNDuH8YpTov7aJFaSKTUBN4suXw+wgtoiAosSW78fBipgFpjJK NO89zAKSEBYwk1g0uRfMZhFQldj8/wIjiM0rYCvxe+08dghbUOLH5HtgNcwCWhLrdx5ngrDl JTaveQt0EgfQSeoSj/7qQuzSk3i9eiobRImIxL4X7xgnMArMQjJpFpJJs5BMmoWkZQEjyypG 0dSC5ILipPRcQ73ixNzi0rx0veT83E2M4Hh+JrWDcWWDxSFGAQ5GJR5ejnzzQCHWxLLiytxD jBIczEoivGHsFoFCvCmJlVWpRfnxRaU5qcWHGJOBHp3ILCWanA9MNXkl8YbGJmZGlkZmFkYm 5uakCSuJ8zKeehIgJJCeWJKanZpakFoEs4WJg1OqgXGi5+SMX0f5apVfNovqb333R8y0pYIt bcbMRjkt0UvbpOV9nPxXOdYer7vjJXejs0DX/4iIXEhKnerqu16pbbLFIeYBTpP5Aw/45yjV zHuj/YJbtC+16uB+oTsFB949cdtYkujR8jtf2zuB/7wui6bPb7cX5R0Hmp6vqdnwtcXAMCMm y2evEktxRqKhFnNRcSIA8gyx2SsDAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS 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. Reviewed-by: Ulf Hansson Acked-by: Jaehoon Chung Signed-off-by: Jingoo Han --- Changes since v2: - added Ulf Hansson's Reviewed-by - added Jaehoon Chung's Acked-by 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 7363efe..128b650 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; @@ -764,15 +764,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); @@ -785,7 +779,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); @@ -805,13 +798,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);