From patchwork Tue Feb 12 03:24:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jingoo Han X-Patchwork-Id: 2126821 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 8E63D3FD56 for ; Tue, 12 Feb 2013 03:24:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752737Ab3BLDYm (ORCPT ); Mon, 11 Feb 2013 22:24:42 -0500 Received: from mailout4.samsung.com ([203.254.224.34]:22516 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752170Ab3BLDYl (ORCPT ); Mon, 11 Feb 2013 22:24:41 -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 <0MI300LPD84TK4B0@mailout4.samsung.com> for linux-mmc@vger.kernel.org; Tue, 12 Feb 2013 12:24:39 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [203.254.230.50]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id B5.EC.03918.7F5B9115; Tue, 12 Feb 2013 12:24:39 +0900 (KST) X-AuditID: cbfee61a-b7f7d6d000000f4e-ba-5119b5f7b699 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 75.EC.03918.7F5B9115; Tue, 12 Feb 2013 12:24:39 +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 <0MI300AE38530F20@mmp1.samsung.com> for linux-mmc@vger.kernel.org; Tue, 12 Feb 2013 12:24:39 +0900 (KST) From: Jingoo Han To: 'Chris Ball' Cc: linux-mmc@vger.kernel.org, 'Ben Dooks' , 'Jingoo Han' Subject: [PATCH v2 RESEND] mmc: sdhci-s3c: Use devm_clk_get() Date: Tue, 12 Feb 2013 12:24:39 +0900 Message-id: <01c101ce08d0$7d8808d0$78981a70$%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: Ac4I0HnaVfFhxtYbR5aQUg3Xey8FBw== Content-language: ko x-cr-hashedpuzzle: AveN DrFI JC9i K5/5 LkqS NiMb PhCZ QgcZ SWvO U+1k ZpDc aKs+ aiWf bJ+M dTGA eTFx; 4; YgBlAG4ALQBsAGkAbgB1AHgAQABmAGwAdQBmAGYALgBvAHIAZwA7AGMAagBiAEAAbABhAHAAdABvAHAALgBvAHIAZwA7AGoAZwAxAC4AaABhAG4AQABzAGEAbQBzAHUAbgBnAC4AYwBvAG0AOwBsAGkAbgB1AHgALQBtAG0AYwBAAHYAZwBlAHIALgBrAGUAcgBuAGUAbAAuAG8AcgBnAA==; Sosha1_v1; 7; {3F1ECD53-6DAE-4912-9337-60DE8C652A6A}; agBnADEALgBoAGEAbgBAAHMAYQBtAHMAdQBuAGcALgBjAG8AbQA=; Tue, 12 Feb 2013 03:24:33 GMT; WwBQAEEAVABDAEgAIAB2ADIAIABSAEUAUwBFAE4ARABdACAAbQBtAGMAOgAgAHMAZABoAGMAaQAtAHMAMwBjADoAIABVAHMAZQAgAGQAZQB2AG0AXwBjAGwAawBfAGcAZQB0ACgAKQA= x-cr-puzzleid: {3F1ECD53-6DAE-4912-9337-60DE8C652A6A} X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrLIsWRmVeSWpSXmKPExsVy+t8zI93vWyUDDX6cU7A48r+f0YHR4/Mm uQDGKC6blNSczLLUIn27BK6MxomzWArOCla0tsY0MJ7g62Lk5JAQMJH4M/cwE4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eZwJwpaX2LzmLVANB9BB6hKP/upCrNKTWLfjHVSJiMS+F+8YQe6UELjBIrHg125W iAdMJR5tu8oygVFoFpIVs5CsmIVkxSwksxYwsqxiFE0tSC4oTkrPNdQrTswtLs1L10vOz93E CI7bZ1I7GFc2WBxiFOBgVOLhvSEuGSjEmlhWXJl7iFGCg1lJhHfZR4lAId6UxMqq1KL8+KLS nNTiQ4zJwBCYyCwlmpwPTCl5JfGGxiZmRpZGZhZGJubmpAkrifMynnoSICSQnliSmp2aWpBa BLOFiYNTqoGx4/1Hexdrmx2JbBYXb5bOyj3eF5jFdya11tXmQnhIkcGmvMrnZ8IV1jVeS2rw uLcnYZ2y2rffZ9q01nGE6z6obShVOXuWK9eTz185P+jJ7zb38592MB6TXvP6Qe/p+GAv409b Vn+xvHxDYgbH8lXsLIK8f7bP/rdh/6HbL9OmLzdasVUlfK6xEktxRqKhFnNRcSIAj5PNkR8D AAA= 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. Signed-off-by: Jingoo Han Reviewed-by: Ulf Hansson Acked-by: Jaehoon Chung --- 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);