]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
mmc: check a return value about regulator's always-on
authorJaehoon Chung <jh80.chung@samsung.com>
Fri, 6 Nov 2020 11:30:41 +0000 (20:30 +0900)
committerPeng Fan <peng.fan@nxp.com>
Sat, 28 Nov 2020 02:44:39 +0000 (10:44 +0800)
Regulator can be set to "always-on".
It's not error about enable/disable. It needs to check about
its condition.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
drivers/mmc/mmc.c

index 54dcfb700311f7b42bfd24fa10a570c10e6e8e1a..a6394bcf308f721b1b50ae8fd3cce5a2a96d796c 100644 (file)
@@ -2720,7 +2720,7 @@ static int mmc_power_on(struct mmc *mmc)
        if (mmc->vmmc_supply) {
                int ret = regulator_set_enable(mmc->vmmc_supply, true);
 
-               if (ret) {
+               if (ret && ret != -EACCES) {
                        printf("Error enabling VMMC supply : %d\n", ret);
                        return ret;
                }
@@ -2736,7 +2736,7 @@ static int mmc_power_off(struct mmc *mmc)
        if (mmc->vmmc_supply) {
                int ret = regulator_set_enable(mmc->vmmc_supply, false);
 
-               if (ret) {
+               if (ret && ret != -EACCES) {
                        pr_debug("Error disabling VMMC supply : %d\n", ret);
                        return ret;
                }