From: Marek Szyprowski Date: Tue, 4 Dec 2012 14:01:02 +0000 (+0100) Subject: mmc: use regulator_can_change_voltage() instead of regulator_count_voltages X-Git-Tag: next-20130218~55^2~6 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=3d3675d47d25ba425835a7b6cfdc59dba2d47e33;p=karo-tx-linux.git 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 Signed-off-by: Chris Ball --- diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 6f3bc1a97ba8..08a3cf2a7610 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -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)