Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 020ede0d authored by Sahitya Tummala's avatar Sahitya Tummala Committed by Xiaonian Wang
Browse files

mmc: sdhci-msm: set the clock rate before enabling it



The drivers must do clk_set_rate() before the first
clk_prepare_enable() is invoked. Otherwise, the clock
driver may give a warning for such clocks.

CRs-fixed: 493685
Change-Id: I8342aa2f35d64a4dc7b8396bd9741c0aecaedc5c
Signed-off-by: default avatarSahitya Tummala <stummala@codeaurora.org>
parent 1958d3d6
Loading
Loading
Loading
Loading
+5 −5
Original line number Original line Diff line number Diff line
@@ -1916,16 +1916,16 @@ static int sdhci_msm_probe(struct platform_device *pdev)
		goto pclk_disable;
		goto pclk_disable;
	}
	}


	ret = clk_prepare_enable(msm_host->clk);
	if (ret)
		goto pclk_disable;

	/* Set to the minimum supported clock frequency */
	/* Set to the minimum supported clock frequency */
	ret = clk_set_rate(msm_host->clk, sdhci_msm_get_min_clock(host));
	ret = clk_set_rate(msm_host->clk, sdhci_msm_get_min_clock(host));
	if (ret) {
	if (ret) {
		dev_err(&pdev->dev, "MClk rate set failed (%d)\n", ret);
		dev_err(&pdev->dev, "MClk rate set failed (%d)\n", ret);
		goto clk_disable;
		goto pclk_disable;
	}
	}
	ret = clk_prepare_enable(msm_host->clk);
	if (ret)
		goto pclk_disable;

	msm_host->clk_rate = sdhci_msm_get_min_clock(host);
	msm_host->clk_rate = sdhci_msm_get_min_clock(host);
	atomic_set(&msm_host->clks_on, 1);
	atomic_set(&msm_host->clks_on, 1);