Skip to contentSkip to conversation

mmc: fsl_esdhc: Gracefully fail on unsupported voltage switch

PATCH New Marek Vasut 2 participants 2 messages May 22, 2020 – May 27, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: fsl_esdhc: Gracefully fail on unsupported voltage switch

Unsupported voltage on voltage switch is not an error, do not print error message in such a case. This happens e.g. if the eMMC is already in 1V8 mode or when testing 1V2 mode operation on systems which only do 3V3/1V8 switching.

Cc Fabio Estevam <[email protected]>
Cc Jaehoon Chung <[email protected]>
Cc Peng Fan <[email protected]>
Cc Stefano Babic <[email protected]>
---
 drivers/mmc/fsl_esdhc_imx.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/mmc/fsl_esdhc_imx.c +3 -2
index f3101a061a..f42e018434 100644
@@ -791,7 +791,7 @@ static int esdhc_set_voltage(struct mmc *mmc)
 	switch (mmc->signal_voltage) {
 	case MMC_SIGNAL_VOLTAGE_330:
 		if (priv->vs18_enable)
-			return -EIO;
+			return -ENOTSUPP;
 #if CONFIG_IS_ENABLED(DM_REGULATOR)
 		if (!IS_ERR_OR_NULL(priv->vqmmc_dev)) {
 			ret = regulator_set_value(priv->vqmmc_dev, 3300000);
@@ -972,7 +972,8 @@ static int esdhc_set_ios_common(struct fsl_esdhc_priv *priv, struct mmc *mmc)
 	if (priv->signal_voltage != mmc->signal_voltage) {
 		ret = esdhc_set_voltage(mmc);
 		if (ret) {
-			printf("esdhc_set_voltage error %d\n", ret);
+			if (ret != -ENOTSUPP)
+				printf("esdhc_set_voltage error %d\n", ret);
 			return ret;
 		}
 	}
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/1 mmc: fsl_esdhc: Gracefully fail on unsupported voltage switch

Quoted 10 lines · Marek Vasut

Unsupported voltage on voltage switch is not an error, do not print error message in such a case. This happens e.g. if the eMMC is already in 1V8 mode or when testing 1V2 mode operation on systems which only do 3V3/1V8 switching.

Cc Fabio Estevam <[email protected]>
Cc Jaehoon Chung <[email protected]>
Cc Peng Fan <[email protected]>
Cc Stefano Babic <[email protected]>
Quoted 28 lines
---
 drivers/mmc/fsl_esdhc_imx.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/mmc/fsl_esdhc_imx.c +3 -2
index f3101a061a..f42e018434 100644
@@ -791,7 +791,7 @@ static int esdhc_set_voltage(struct mmc *mmc)
 	switch (mmc->signal_voltage) {
 	case MMC_SIGNAL_VOLTAGE_330:
 		if (priv->vs18_enable)
-			return -EIO;
+			return -ENOTSUPP;
 #if CONFIG_IS_ENABLED(DM_REGULATOR)
 		if (!IS_ERR_OR_NULL(priv->vqmmc_dev)) {
 			ret = regulator_set_value(priv->vqmmc_dev, 3300000);
@@ -972,7 +972,8 @@ static int esdhc_set_ios_common(struct fsl_esdhc_priv *priv, struct mmc *mmc)
 	if (priv->signal_voltage != mmc->signal_voltage) {
 		ret = esdhc_set_voltage(mmc);
 		if (ret) {
-			printf("esdhc_set_voltage error %d\n", ret);
+			if (ret != -ENOTSUPP)
+				printf("esdhc_set_voltage error %d\n", ret);
 			return ret;
 		}
 	}