From: Chen-Yu Tsai Date: Tue, 3 Mar 2015 01:44:40 +0000 (+0800) Subject: mmc: sunxi: Use devm_reset_control_get_optional() for reset control X-Git-Tag: v3.18.14~163 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7c06756c1d6a373c9dec8123ac34854d0547e468;p=thirdparty%2Fkernel%2Fstable.git mmc: sunxi: Use devm_reset_control_get_optional() for reset control [ Upstream commit 9e71c589e44ddf2b86f361c81e360c6b0d0354b1 ] 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: Chen-Yu Tsai Cc: # 3.16+ Acked-by: David Lanzendörfer Signed-off-by: Ulf Hansson Signed-off-by: Sasha Levin --- diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c index d1663b3c41436..aac659bdd08ab 100644 --- a/drivers/mmc/host/sunxi-mmc.c +++ b/drivers/mmc/host/sunxi-mmc.c @@ -909,7 +909,9 @@ static int sunxi_mmc_resource_request(struct sunxi_mmc_host *host, 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); if (ret) {