diff mbox series

mmc: check a return value about regulator's always-on

Message ID 20201106113041.25988-1-jh80.chung@samsung.com
State Not Applicable
Delegated to: Peng Fan
Headers show
Series mmc: check a return value about regulator's always-on | expand

Commit Message

Jaehoon Chung Nov. 6, 2020, 11:30 a.m. UTC
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>
---
 drivers/mmc/mmc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Peng Fan Nov. 9, 2020, 2:13 a.m. UTC | #1
> Subject: [PATCH] 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>
> ---
>  drivers/mmc/mmc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index
> 2457c6fef97a..9526d27976c7 100644
> --- a/drivers/mmc/mmc.c
> +++ b/drivers/mmc/mmc.c
> @@ -2745,7 +2745,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) {
>  			puts("Error enabling VMMC supply : %d\n", ret);
>  			return ret;
>  		}
> @@ -2761,7 +2761,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;
>  		}
> --

Reviewed-by: Peng Fan <peng.fan@nxp.com>
diff mbox series

Patch

diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 2457c6fef97a..9526d27976c7 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -2745,7 +2745,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) {
 			puts("Error enabling VMMC supply : %d\n", ret);
 			return ret;
 		}
@@ -2761,7 +2761,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;
 		}