@@ -2980,13 +2980,13 @@ int sdhci_add_host(struct sdhci_host *host)
if (host->vmmc) {
ret = regulator_is_supported_voltage(host->vmmc, 2700000,
3600000);
- if ((ret <= 0) || (!(caps[0] & SDHCI_CAN_VDD_330)))
+ if ((ret <= 0) && (caps[0] & SDHCI_CAN_VDD_330))
caps[0] &= ~SDHCI_CAN_VDD_330;
- if ((ret <= 0) || (!(caps[0] & SDHCI_CAN_VDD_300)))
+ if ((ret <= 0) && (caps[0] & SDHCI_CAN_VDD_300))
caps[0] &= ~SDHCI_CAN_VDD_300;
ret = regulator_is_supported_voltage(host->vmmc, 1700000,
1950000);
- if ((ret <= 0) || (!(caps[0] & SDHCI_CAN_VDD_180)))
+ if ((ret <= 0) && (caps[0] & SDHCI_CAN_VDD_180))
caps[0] &= ~SDHCI_CAN_VDD_180;
}
#endif /* CONFIG_REGULATOR */
Correct the judgement logic. When regulator vmmc is used, the voltage caps should be cleared manually when both below conditions are true: 1. The requested voltage range is actually not supported by the regulator. 2. The voltage caps read from the capability register has been set. Signed-off-by: Kevin Liu <kliu5@marvell.com> --- drivers/mmc/host/sdhci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)