From patchwork Wed Jul 3 20:02:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 2820061 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3F8009F3EB for ; Wed, 3 Jul 2013 20:02:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D113E20308 for ; Wed, 3 Jul 2013 20:02:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F01A5202FE for ; Wed, 3 Jul 2013 20:02:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932858Ab3GCUCz (ORCPT ); Wed, 3 Jul 2013 16:02:55 -0400 Received: from mail-yh0-f42.google.com ([209.85.213.42]:35815 "EHLO mail-yh0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932690Ab3GCUCy (ORCPT ); Wed, 3 Jul 2013 16:02:54 -0400 Received: by mail-yh0-f42.google.com with SMTP id c41so194973yho.15 for ; Wed, 03 Jul 2013 13:02:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=lj6vXmdjXx+d9UymBgwDe1livpaS8irj5udByHftdqA=; b=aPaQMb+4DDEsaCYa0rSGV1/Ab3oa+GrbXn190Uzwdi7YzJDAgYI6TRiv5hGKIX3uVe A6eWIXswOcu8QemfU637eXE+Yvt2lRUK4g9JJWZGk8SvWtKUvV/Rt1NFYth4IEmZsxz5 uNUUQEW9PzIUr2+H0BBmkFAliZhKjOlvL8TadGHW/M5UbDNon6Lf8CmDrLN0J/xQSSuG Ju+YkgX4u11W35VHL6509e2E5nr1uPlGS1j2PN3AH2t2MT/M1aB3XAYwqyVc8KRHLN9x wS57VK4pY0VCTiNvjFxcA8CViGpn6gfJ9bfBzTvW9jgW0hjtsJrSFJzDljGM9RQWH02R gz4g== X-Received: by 10.236.136.200 with SMTP id w48mr1076333yhi.74.1372881774105; Wed, 03 Jul 2013 13:02:54 -0700 (PDT) Received: from localhost.localdomain ([187.106.36.171]) by mx.google.com with ESMTPSA id w12sm48300921yhj.19.2013.07.03.13.02.52 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Jul 2013 13:02:53 -0700 (PDT) From: Fabio Estevam To: cjb@laptop.org Cc: shawn.guo@linaro.org, kernel@pengutronix.de, linux-mmc@vger.kernel.org, Fabio Estevam Subject: [PATCH 1/2] mmc: mxs-mmc: Use devm_clk_get() Date: Wed, 3 Jul 2013 17:02:37 -0300 Message-Id: <1372881758-23502-1-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 1.8.1.2 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Using devm_clk_get() allows us to remove the clk_put() calls, so let's use it to simplify the code. Rename the 'out_clk_put' label to 'out_clk_disable' now that clk_put is removed. Signed-off-by: Fabio Estevam Acked-by: Shawn Guo --- drivers/mmc/host/mxs-mmc.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c index f38d75f..b76778f 100644 --- a/drivers/mmc/host/mxs-mmc.c +++ b/drivers/mmc/host/mxs-mmc.c @@ -618,7 +618,7 @@ static int mxs_mmc_probe(struct platform_device *pdev) } } - ssp->clk = clk_get(&pdev->dev, NULL); + ssp->clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(ssp->clk)) { ret = PTR_ERR(ssp->clk); goto out_mmc_free; @@ -632,7 +632,7 @@ static int mxs_mmc_probe(struct platform_device *pdev) dev_err(mmc_dev(host->mmc), "%s: failed to request dma\n", __func__); ret = -ENODEV; - goto out_clk_put; + goto out_clk_disable; } /* set mmc core parameters */ @@ -685,9 +685,8 @@ static int mxs_mmc_probe(struct platform_device *pdev) out_free_dma: if (ssp->dmach) dma_release_channel(ssp->dmach); -out_clk_put: +out_clk_disable: clk_disable_unprepare(ssp->clk); - clk_put(ssp->clk); out_mmc_free: mmc_free_host(mmc); return ret; @@ -705,7 +704,6 @@ static int mxs_mmc_remove(struct platform_device *pdev) dma_release_channel(ssp->dmach); clk_disable_unprepare(ssp->clk); - clk_put(ssp->clk); mmc_free_host(mmc);