mmc: mxs-mmc: Use devm_clk_get()

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>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
This commit is contained in:
Fabio Estevam 2013-07-03 17:02:37 -03:00 committed by Chris Ball
parent 3e7e8c18a1
commit a5adbffda8
1 changed files with 3 additions and 5 deletions

View File

@ -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)) { if (IS_ERR(ssp->clk)) {
ret = PTR_ERR(ssp->clk); ret = PTR_ERR(ssp->clk);
goto out_mmc_free; goto out_mmc_free;
@ -632,7 +632,7 @@ static int mxs_mmc_probe(struct platform_device *pdev)
dev_err(mmc_dev(host->mmc), dev_err(mmc_dev(host->mmc),
"%s: failed to request dma\n", __func__); "%s: failed to request dma\n", __func__);
ret = -ENODEV; ret = -ENODEV;
goto out_clk_put; goto out_clk_disable;
} }
/* set mmc core parameters */ /* set mmc core parameters */
@ -685,9 +685,8 @@ static int mxs_mmc_probe(struct platform_device *pdev)
out_free_dma: out_free_dma:
if (ssp->dmach) if (ssp->dmach)
dma_release_channel(ssp->dmach); dma_release_channel(ssp->dmach);
out_clk_put: out_clk_disable:
clk_disable_unprepare(ssp->clk); clk_disable_unprepare(ssp->clk);
clk_put(ssp->clk);
out_mmc_free: out_mmc_free:
mmc_free_host(mmc); mmc_free_host(mmc);
return ret; return ret;
@ -705,7 +704,6 @@ static int mxs_mmc_remove(struct platform_device *pdev)
dma_release_channel(ssp->dmach); dma_release_channel(ssp->dmach);
clk_disable_unprepare(ssp->clk); clk_disable_unprepare(ssp->clk);
clk_put(ssp->clk);
mmc_free_host(mmc); mmc_free_host(mmc);