aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@linaro.org>2013-05-13 10:39:17 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2013-05-22 19:07:00 -0400
commit665ba56fdab1670ef686ec35569aa1de0ec4ef4d (patch)
treef656981b702ba406c38c00e21dd7fd72a6f0749b
parentc7788792a5e7b0d5d7f96d0766b4cb6112d47d75 (diff)
ARM: 7717/1: mmc: mmci: Use devm_clk_get API
Converting to devm_clk_get simplifies error handling in probe and we can remove other corresponding calls to clk_put. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r--drivers/mmc/host/mmci.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index f4f3038c1df0..d57ce4332f83 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -1362,16 +1362,15 @@ static int mmci_probe(struct amba_device *dev,
1362 dev_dbg(mmc_dev(mmc), "designer ID = 0x%02x\n", host->hw_designer); 1362 dev_dbg(mmc_dev(mmc), "designer ID = 0x%02x\n", host->hw_designer);
1363 dev_dbg(mmc_dev(mmc), "revision = 0x%01x\n", host->hw_revision); 1363 dev_dbg(mmc_dev(mmc), "revision = 0x%01x\n", host->hw_revision);
1364 1364
1365 host->clk = clk_get(&dev->dev, NULL); 1365 host->clk = devm_clk_get(&dev->dev, NULL);
1366 if (IS_ERR(host->clk)) { 1366 if (IS_ERR(host->clk)) {
1367 ret = PTR_ERR(host->clk); 1367 ret = PTR_ERR(host->clk);
1368 host->clk = NULL;
1369 goto host_free; 1368 goto host_free;
1370 } 1369 }
1371 1370
1372 ret = clk_prepare_enable(host->clk); 1371 ret = clk_prepare_enable(host->clk);
1373 if (ret) 1372 if (ret)
1374 goto clk_free; 1373 goto host_free;
1375 1374
1376 host->plat = plat; 1375 host->plat = plat;
1377 host->variant = variant; 1376 host->variant = variant;
@@ -1576,8 +1575,6 @@ static int mmci_probe(struct amba_device *dev,
1576 iounmap(host->base); 1575 iounmap(host->base);
1577 clk_disable: 1576 clk_disable:
1578 clk_disable_unprepare(host->clk); 1577 clk_disable_unprepare(host->clk);
1579 clk_free:
1580 clk_put(host->clk);
1581 host_free: 1578 host_free:
1582 mmc_free_host(mmc); 1579 mmc_free_host(mmc);
1583 rel_regions: 1580 rel_regions:
@@ -1623,7 +1620,6 @@ static int mmci_remove(struct amba_device *dev)
1623 1620
1624 iounmap(host->base); 1621 iounmap(host->base);
1625 clk_disable_unprepare(host->clk); 1622 clk_disable_unprepare(host->clk);
1626 clk_put(host->clk);
1627 1623
1628 mmc_free_host(mmc); 1624 mmc_free_host(mmc);
1629 1625