Skip to content
This repository has been archived by the owner on Oct 5, 2018. It is now read-only.

Commit

Permalink
mmc: dw_mmc: fix warning of clk_prepare_enable/clk_disable_unprepare
Browse files Browse the repository at this point in the history
Signed-off-by: Zhangfei Gao <[email protected]>
  • Loading branch information
zhangfeigao committed Apr 9, 2015
1 parent 9a89d44 commit 0f7950e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions drivers/mmc/host/dw_mmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2642,13 +2642,20 @@ int dw_mci_probe(struct dw_mci *host)
host->bus_hz = host->pdata->bus_hz;
} else {
if (host->pdata->bus_hz) {
ret = clk_set_rate(host->biu_clk, host->pdata->bus_hz);
ret = clk_set_rate(host->ciu_clk, host->pdata->bus_hz);
if (ret)
dev_warn(host->dev,
"Unable to set bus rate to %uHz\n",
host->pdata->bus_hz);
}
host->bus_hz = clk_get_rate(host->biu_clk);

ret = clk_prepare_enable(host->ciu_clk);
if (ret) {
dev_err(host->dev, "failed to enable ciu clock\n");
goto err_clk_biu;
}

host->bus_hz = clk_get_rate(host->ciu_clk);
}

if (!host->bus_hz) {
Expand Down Expand Up @@ -2818,6 +2825,7 @@ int dw_mci_probe(struct dw_mci *host)
if (!IS_ERR(host->ciu_clk))
clk_disable_unprepare(host->ciu_clk);

err_clk_biu:
if (!IS_ERR(host->biu_clk))
clk_disable_unprepare(host->biu_clk);

Expand Down

0 comments on commit 0f7950e

Please sign in to comment.