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

mmc: sunxi: Use devm_reset_control_get_optional() for reset control

The reset control for the sunxi mmc controller is optional. Some
newer platforms (sun6i, sun8i, sun9i) have it, while older ones
(sun4i, sun5i, sun7i) don't.

Use the properly stubbed _optional version so the driver does not
fail to compile when RESET_CONTROLLER=n.

This patch also adds a check for deferred probing on the reset
control.
Signed-off-by: NChen-Yu Tsai <wens@csie.org>
Cc: <stable@vger.kernel.org> # 3.16+
Acked-by: NDavid Lanzendörfer <david.lanzendoerfer@o2s.ch>
Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
上级 caebcae9
......@@ -930,7 +930,9 @@ static int sunxi_mmc_resource_request(struct sunxi_mmc_host *host,
return PTR_ERR(host->clk_sample);
}
host->reset = devm_reset_control_get(&pdev->dev, "ahb");
host->reset = devm_reset_control_get_optional(&pdev->dev, "ahb");
if (PTR_ERR(host->reset) == -EPROBE_DEFER)
return PTR_ERR(host->reset);
ret = clk_prepare_enable(host->clk_ahb);
if (ret) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册