]> git.openfabrics.org - ~shefty/rdma-dev.git/blobdiff - drivers/regulator/core.c
Merge remote-tracking branches 'regulator/fix/gpio', 'regulator/fix/put' and 'regulat...
[~shefty/rdma-dev.git] / 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);