Skip to contentSkip to conversation

mmc: meson-gx: simplify usage of mmc_regulator_set_ocr

PATCH In review Heiner Kallweit 3 participants 3 messages Mar 11, 2023 – Mar 23, 2023

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

PATCH 1/1 mmc: meson-gx: simplify usage of mmc_regulator_set_ocr

After 087592395a96 ("mmc: core: Allow invalid regulator in mmc_regulator_set_ocr()") we can remove the checks here.

---
 drivers/mmc/host/meson-gx-mmc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/mmc/host/meson-gx-mmc.c +2 -4
index 2b963a81c..28e04dc4e 100644
@@ -604,8 +604,7 @@ static void meson_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 	 */
 	switch (ios->power_mode) {
 	case MMC_POWER_OFF:
-		if (!IS_ERR(mmc->supply.vmmc))
-			mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0);
+		mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0);
 
 		if (!IS_ERR(mmc->supply.vqmmc) && host->vqmmc_enabled) {
 			regulator_disable(mmc->supply.vqmmc);
@@ -615,8 +614,7 @@ static void meson_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 		break;
 
 	case MMC_POWER_UP:
-		if (!IS_ERR(mmc->supply.vmmc))
-			mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, ios->vdd);
+		mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, ios->vdd);
 
 		break;
 
Signature · 1 line
2.39.2
#2 lore raw
In reply to Heiner Kallweit
Quoted 5 lines · Heiner Kallweit

After 087592395a96 ("mmc: core: Allow invalid regulator in mmc_regulator_set_ocr()") we can remove the checks here.

Applied for next, thanks!

Kind regards
Uffe

Quoted 31 lines
---
 drivers/mmc/host/meson-gx-mmc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/mmc/host/meson-gx-mmc.c +2 -5
index 2b963a81c..28e04dc4e 100644
@@ -604,8 +604,7 @@ static void meson_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
         */
        switch (ios->power_mode) {
        case MMC_POWER_OFF:
-               if (!IS_ERR(mmc->supply.vmmc))
-                       mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0);
+               mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0);
 
                if (!IS_ERR(mmc->supply.vqmmc) && host->vqmmc_enabled) {
                        regulator_disable(mmc->supply.vqmmc);
@@ -615,8 +614,7 @@ static void meson_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
                break;
 
        case MMC_POWER_UP:
-               if (!IS_ERR(mmc->supply.vmmc))
-                       mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, ios->vdd);
+               mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, ios->vdd);
 
                break;
 
--

2.39.2