Skip to content

Commit

Permalink
mmc: omap_hsmmc: use devm_clk_get
Browse files Browse the repository at this point in the history
With devm_clk_get conversion clk_put can be removed in clean up path

Signed-off-by: Balaji T K <balajitk@ti.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
  • Loading branch information
Balaji T K authored and Chris Ball committed May 22, 2014
1 parent 19b7f79 commit 9618195
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions drivers/mmc/host/omap_hsmmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1922,7 +1922,7 @@ static int omap_hsmmc_probe(struct platform_device *pdev)

spin_lock_init(&host->irq_lock);

host->fclk = clk_get(&pdev->dev, "fck");
host->fclk = devm_clk_get(&pdev->dev, "fck");
if (IS_ERR(host->fclk)) {
ret = PTR_ERR(host->fclk);
host->fclk = NULL;
Expand All @@ -1941,15 +1941,14 @@ static int omap_hsmmc_probe(struct platform_device *pdev)

omap_hsmmc_context_save(host);

host->dbclk = clk_get(&pdev->dev, "mmchsdb_fck");
host->dbclk = devm_clk_get(&pdev->dev, "mmchsdb_fck");
/*
* MMC can still work without debounce clock.
*/
if (IS_ERR(host->dbclk)) {
host->dbclk = NULL;
} else if (clk_prepare_enable(host->dbclk) != 0) {
dev_warn(mmc_dev(host->mmc), "Failed to enable debounce clk\n");
clk_put(host->dbclk);
host->dbclk = NULL;
}

Expand Down Expand Up @@ -2105,11 +2104,8 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
dma_release_channel(host->rx_chan);
pm_runtime_put_sync(host->dev);
pm_runtime_disable(host->dev);
clk_put(host->fclk);
if (host->dbclk) {
if (host->dbclk)
clk_disable_unprepare(host->dbclk);
clk_put(host->dbclk);
}
err1:
iounmap(host->base);
mmc_free_host(mmc);
Expand Down Expand Up @@ -2144,11 +2140,8 @@ static int omap_hsmmc_remove(struct platform_device *pdev)

pm_runtime_put_sync(host->dev);
pm_runtime_disable(host->dev);
clk_put(host->fclk);
if (host->dbclk) {
if (host->dbclk)
clk_disable_unprepare(host->dbclk);
clk_put(host->dbclk);
}

omap_hsmmc_gpio_free(host->pdata);
iounmap(host->base);
Expand Down

0 comments on commit 9618195

Please sign in to comment.