Skip to content

Commit

Permalink
mmc: use regulator_can_change_voltage() instead of regulator_count_vo…
Browse files Browse the repository at this point in the history
…ltages

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 <m.szyprowski@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
  • Loading branch information
Marek Szyprowski authored and Chris Ball committed Feb 24, 2013
1 parent bb691ae commit 5f56a8e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/mmc/core/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1235,7 +1235,7 @@ int mmc_regulator_set_ocr(struct mmc_host *mmc,
*/
voltage = regulator_get_voltage(supply);

if (regulator_count_voltages(supply) == 1)
if (!regulator_can_change_voltage(supply))
min_uV = max_uV = voltage;

if (voltage < 0)
Expand Down

0 comments on commit 5f56a8e

Please sign in to comment.