aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorFabio Estevam <festevam@gmail.com>2013-07-03 16:02:37 -0400
committerChris Ball <cjb@laptop.org>2013-08-24 22:06:51 -0400
commita5adbffda8d88a9e96c579b337b12cc8a6863575 (patch)
tree346f7d851ac98146f09181cfc7d66c394de70917 /drivers/mmc
parent3e7e8c18a15102c3042206c067356e6c39961725 (diff)
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>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/mxs-mmc.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
index f38d75f46f78..b76778fe81b0 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)
618 } 618 }
619 } 619 }
620 620
621 ssp->clk = clk_get(&pdev->dev, NULL); 621 ssp->clk = devm_clk_get(&pdev->dev, NULL);
622 if (IS_ERR(ssp->clk)) { 622 if (IS_ERR(ssp->clk)) {
623 ret = PTR_ERR(ssp->clk); 623 ret = PTR_ERR(ssp->clk);
624 goto out_mmc_free; 624 goto out_mmc_free;
@@ -632,7 +632,7 @@ static int mxs_mmc_probe(struct platform_device *pdev)
632 dev_err(mmc_dev(host->mmc), 632 dev_err(mmc_dev(host->mmc),
633 "%s: failed to request dma\n", __func__); 633 "%s: failed to request dma\n", __func__);
634 ret = -ENODEV; 634 ret = -ENODEV;
635 goto out_clk_put; 635 goto out_clk_disable;
636 } 636 }
637 637
638 /* set mmc core parameters */ 638 /* set mmc core parameters */
@@ -685,9 +685,8 @@ static int mxs_mmc_probe(struct platform_device *pdev)
685out_free_dma: 685out_free_dma:
686 if (ssp->dmach) 686 if (ssp->dmach)
687 dma_release_channel(ssp->dmach); 687 dma_release_channel(ssp->dmach);
688out_clk_put: 688out_clk_disable:
689 clk_disable_unprepare(ssp->clk); 689 clk_disable_unprepare(ssp->clk);
690 clk_put(ssp->clk);
691out_mmc_free: 690out_mmc_free:
692 mmc_free_host(mmc); 691 mmc_free_host(mmc);
693 return ret; 692 return ret;
@@ -705,7 +704,6 @@ static int mxs_mmc_remove(struct platform_device *pdev)
705 dma_release_channel(ssp->dmach); 704 dma_release_channel(ssp->dmach);
706 705
707 clk_disable_unprepare(ssp->clk); 706 clk_disable_unprepare(ssp->clk);
708 clk_put(ssp->clk);
709 707
710 mmc_free_host(mmc); 708 mmc_free_host(mmc);
711 709