提交 a6461134 编写于 作者: C Chen-Yu Tsai 提交者: Ulf Hansson

mmc: sunxi: Fix NULL pointer reference on clk_delays

Some SoCs do not support clk delays for MMC in the clock control unit.
These include the old controllers in A10/A10s/A13/R8, and the new eMMC
controller in A64. The config structure for these controllers do not
specify clk_delays, but the check for this was replaced in change
"mmc: sunxi: Support controllers that can use both old and new timings".

This patch adds back the check for clk_delays, and also adds comments
for both checks in sunxi_mmc_clk_set_phase().
Signed-off-by: NChen-Yu Tsai <wens@csie.org>
Tested-by: NIcenowy Zheng <icenowy@aosc.io>
Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
上级 ac98caef
...@@ -722,9 +722,14 @@ static int sunxi_mmc_clk_set_phase(struct sunxi_mmc_host *host, ...@@ -722,9 +722,14 @@ static int sunxi_mmc_clk_set_phase(struct sunxi_mmc_host *host,
{ {
int index; int index;
/* clk controller delays not used under new timings mode */
if (host->use_new_timings) if (host->use_new_timings)
return 0; return 0;
/* some old controllers don't support delays */
if (!host->cfg->clk_delays)
return 0;
/* determine delays */ /* determine delays */
if (rate <= 400000) { if (rate <= 400000) {
index = SDXC_CLK_400K; index = SDXC_CLK_400K;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册