diff mbox

[1/2] mmc: mxs-mmc: Use devm_clk_get()

Message ID 1372881758-23502-1-git-send-email-festevam@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Fabio Estevam July 3, 2013, 8:02 p.m. UTC
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 <festevam@gmail.com>
---
 drivers/mmc/host/mxs-mmc.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

Comments

Shawn Guo July 4, 2013, 1:27 a.m. UTC | #1
On Wed, Jul 03, 2013 at 05:02:37PM -0300, Fabio Estevam wrote:
> 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 <festevam@gmail.com>

Both,

Acked-by: Shawn Guo <shawn.guo@linaro.org>

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Chris Ball Aug. 25, 2013, 2:07 a.m. UTC | #2
Hi Fabio,

On Wed, Jul 03 2013, Shawn Guo wrote:
> On Wed, Jul 03, 2013 at 05:02:37PM -0300, Fabio Estevam wrote:
>> 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 <festevam@gmail.com>
>
> Both,
>
> Acked-by: Shawn Guo <shawn.guo@linaro.org>

Thanks, both pushed to mmc-next for 3.12.

- Chris.
diff mbox

Patch

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);