Commit d6e6b425 authored by Chen-Yu Tsai's avatar Chen-Yu Tsai Committed by Greg Kroah-Hartman

mmc: sunxi: Use devm_reset_control_get_optional() for reset control

commit 9e71c589 upstream.

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: default avatarChen-Yu Tsai <wens@csie.org>
Acked-by: default avatarDavid Lanzendörfer <david.lanzendoerfer@o2s.ch>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 28b8f9e0
...@@ -908,7 +908,9 @@ static int sunxi_mmc_resource_request(struct sunxi_mmc_host *host, ...@@ -908,7 +908,9 @@ static int sunxi_mmc_resource_request(struct sunxi_mmc_host *host,
return PTR_ERR(host->clk_mmc); return PTR_ERR(host->clk_mmc);
} }
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); ret = clk_prepare_enable(host->clk_ahb);
if (ret) { if (ret) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment