mmc: check a return value about regulator's always-on
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>
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 54dcfb7..a6394bc 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -2720,7 +2720,7 @@
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 @@
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;
}