Skip to content

Commit 5f56a8e

Browse files
mszyprowcjb
authored andcommitted
mmc: use regulator_can_change_voltage() instead of regulator_count_voltages
mmc_regulator_set_ocr() depends on the ability of regulator to change the voltage value. When regulator cannot change its voltage output, some code is skipped to avoid reporting false errors on some boards, which use MMC hosts with fixed regulators (e.g. Samsung Goni and UniversalC210 boards). This patch replaces a hacky workaround based on regulator_count_voltages() value with the correct call to recently introduced regulator_can_change_voltage() function in regulators core. Signed-off-by: Marek Szyprowski <[email protected]> Signed-off-by: Chris Ball <[email protected]>
1 parent bb691ae commit 5f56a8e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/mmc/core/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1235,7 +1235,7 @@ int mmc_regulator_set_ocr(struct mmc_host *mmc,
12351235
*/
12361236
voltage = regulator_get_voltage(supply);
12371237

1238-
if (regulator_count_voltages(supply) == 1)
1238+
if (!regulator_can_change_voltage(supply))
12391239
min_uV = max_uV = voltage;
12401240

12411241
if (voltage < 0)

0 commit comments

Comments
 (0)