mmc: core: Remove fixed voltage regulator logic
authorTim Kryger <tim.kryger@gmail.com>
Tue, 12 Aug 2014 05:05:12 +0000 (22:05 -0700)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 9 Sep 2014 11:58:57 +0000 (13:58 +0200)
There is no need for regulator consumers to include special logic for
fixed voltage regulators as they support regulator_set_voltage() just
like their non-fixed regulator counterparts.

Signed-off-by: Tim Kryger <tim.kryger@gmail.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/core/core.c

index d03a080fb9cd35ff0b29bf50380f08fdd8818c23..2eb7c82ba4a25d131be6bcaba1565a85b969eafc 100644 (file)
@@ -1263,7 +1263,6 @@ int mmc_regulator_set_ocr(struct mmc_host *mmc,
 
        if (vdd_bit) {
                int             tmp;
-               int             voltage;
 
                /*
                 * REVISIT mmc_vddrange_to_ocrmask() may have set some
@@ -1280,22 +1279,7 @@ int mmc_regulator_set_ocr(struct mmc_host *mmc,
                        max_uV = min_uV + 100 * 1000;
                }
 
-               /*
-                * If we're using a fixed/static regulator, don't call
-                * regulator_set_voltage; it would fail.
-                */
-               voltage = regulator_get_voltage(supply);
-
-               if (!regulator_can_change_voltage(supply))
-                       min_uV = max_uV = voltage;
-
-               if (voltage < 0)
-                       result = voltage;
-               else if (voltage < min_uV || voltage > max_uV)
-                       result = regulator_set_voltage(supply, min_uV, max_uV);
-               else
-                       result = 0;
-
+               result = regulator_set_voltage(supply, min_uV, max_uV);
                if (result == 0 && !mmc->regulator_enabled) {
                        result = regulator_enable(supply);
                        if (!result)
This page took 0.025459 seconds and 5 git commands to generate.