]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mmc: sunxi: Use devm_reset_control_get_optional() for reset control
authorChen-Yu Tsai <wens@csie.org>
Tue, 3 Mar 2015 01:44:40 +0000 (09:44 +0800)
committerLuis Henriques <luis.henriques@canonical.com>
Tue, 5 May 2015 10:09:30 +0000 (11:09 +0100)
commit 9e71c589e44ddf2b86f361c81e360c6b0d0354b1 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: Chen-Yu Tsai <wens@csie.org>
Acked-by: David Lanzendörfer <david.lanzendoerfer@o2s.ch>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
drivers/mmc/host/sunxi-mmc.c

index 024f67c98cdcad3b741e3b5ec39ad8b17a670d8c..97823c68600a20b018d851a4bea31b9e5b1f8b66 100644 (file)
@@ -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) {