]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge remote-tracking branches 'regulator/fix/gpio', 'regulator/fix/put' and 'regulat...
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Thu, 15 Nov 2012 02:16:02 +0000 (11:16 +0900)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Thu, 15 Nov 2012 02:16:02 +0000 (11:16 +0900)
drivers/regulator/core.c

index 3ebc06b280abc02b92e2adf2d705a4cc980c6537..e872c8be080ed427a2e546efffee50c12acdd9fe 100644 (file)
@@ -1980,7 +1980,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;
        }
@@ -3371,7 +3371,7 @@ regulator_register(const struct regulator_desc *regulator_desc,
                if (ret != 0) {
                        rdev_err(rdev, "Failed to request enable GPIO%d: %d\n",
                                 config->ena_gpio, ret);
-                       goto clean;
+                       goto wash;
                }
 
                rdev->ena_gpio = config->ena_gpio;
@@ -3455,6 +3455,7 @@ scrub:
        if (rdev->ena_gpio)
                gpio_free(rdev->ena_gpio);
        kfree(rdev->constraints);
+wash:
        device_unregister(&rdev->dev);
        /* device core frees rdev */
        rdev = ERR_PTR(ret);