]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
regulator: fix voltage check in regulator_is_supported_voltage()
authorMarek Szyprowski <m.szyprowski@samsung.com>
Tue, 13 Nov 2012 08:48:51 +0000 (09:48 +0100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Thu, 15 Nov 2012 02:14:18 +0000 (11:14 +0900)
regulator_is_supported_voltage() should return true only if the voltage
of fixed/constant regulator is between min_uV and max_uV.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@vger.kernel.org
drivers/regulator/core.c

index 5c4829cba6a62de6168c6bb3c4913812e5e8b4e1..27eb9d66f06a653da86018450cdb91de905cc03f 100644 (file)
@@ -1974,7 +1974,7 @@ int regulator_is_supported_voltage(struct regulator *regulator,
        if (!(rdev->constraints->valid_ops_mask & REGULATOR_CHANGE_VOLTAGE)) {
                ret = regulator_get_voltage(regulator);
                if (ret >= 0)
-                       return (min_uV >= ret && ret <= max_uV);
+                       return (min_uV <= ret && ret <= max_uV);
                else
                        return ret;
        }