mmc: sunxi: Return error on mmc_regulator_set_ocr() fail in .set_ios op
authorChen-Yu Tsai <wens@csie.org>
Thu, 21 Jan 2016 05:26:29 +0000 (13:26 +0800)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 29 Feb 2016 10:02:50 +0000 (11:02 +0100)
Let .set_ios() fail if mmc_regulator_set_ocr() fails to enable and set a
proper voltage for vmmc.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/sunxi-mmc.c

index cce5ca540857f5b3f0e6ba08f9b7557ff677b855..790f01662b4e6af7ed6cdb941cac5dd34af6c91e 100644 (file)
@@ -711,7 +711,10 @@ static void sunxi_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
                break;
 
        case MMC_POWER_UP:
-               mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, ios->vdd);
+               host->ferror = mmc_regulator_set_ocr(mmc, mmc->supply.vmmc,
+                                                    ios->vdd);
+               if (host->ferror)
+                       return;
 
                host->ferror = sunxi_mmc_init_host(mmc);
                if (host->ferror)