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

Commit 0f7950e

Browse files
committed
mmc: dw_mmc: fix warning of clk_prepare_enable/clk_disable_unprepare
Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
1 parent 9a89d44 commit 0f7950e

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

drivers/mmc/host/dw_mmc.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2642,13 +2642,20 @@ int dw_mci_probe(struct dw_mci *host)
26422642
host->bus_hz = host->pdata->bus_hz;
26432643
} else {
26442644
if (host->pdata->bus_hz) {
2645-
ret = clk_set_rate(host->biu_clk, host->pdata->bus_hz);
2645+
ret = clk_set_rate(host->ciu_clk, host->pdata->bus_hz);
26462646
if (ret)
26472647
dev_warn(host->dev,
26482648
"Unable to set bus rate to %uHz\n",
26492649
host->pdata->bus_hz);
26502650
}
2651-
host->bus_hz = clk_get_rate(host->biu_clk);
2651+
2652+
ret = clk_prepare_enable(host->ciu_clk);
2653+
if (ret) {
2654+
dev_err(host->dev, "failed to enable ciu clock\n");
2655+
goto err_clk_biu;
2656+
}
2657+
2658+
host->bus_hz = clk_get_rate(host->ciu_clk);
26522659
}
26532660

26542661
if (!host->bus_hz) {
@@ -2818,6 +2825,7 @@ int dw_mci_probe(struct dw_mci *host)
28182825
if (!IS_ERR(host->ciu_clk))
28192826
clk_disable_unprepare(host->ciu_clk);
28202827

2828+
err_clk_biu:
28212829
if (!IS_ERR(host->biu_clk))
28222830
clk_disable_unprepare(host->biu_clk);
28232831

0 commit comments

Comments
 (0)