diff options
author | Chen-Yu Tsai <wens@csie.org> | 2015-03-03 09:44:40 +0800 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2015-03-23 14:13:35 +0100 |
commit | 9e71c589e44ddf2b86f361c81e360c6b0d0354b1 (patch) | |
tree | 211a93fe32338b2d4afc2a31b139d56363fbb17f /drivers/mmc | |
parent | caebcae94fc01aef409ea0cabf0c327b6c23840e (diff) | |
download | linux-9e71c589e44ddf2b86f361c81e360c6b0d0354b1.tar.bz2 |
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: Chen-Yu Tsai <wens@csie.org>
Cc: <stable@vger.kernel.org> # 3.16+
Acked-by: David Lanzendörfer <david.lanzendoerfer@o2s.ch>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/host/sunxi-mmc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c index e8a4218b5726..459ed1b601db 100644 --- a/drivers/mmc/host/sunxi-mmc.c +++ b/drivers/mmc/host/sunxi-mmc.c @@ -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) { |