regulator: core: Fix default return value for _get()
authorMark Brown <broonie@linaro.org>
Fri, 20 Sep 2013 11:23:30 +0000 (12:23 +0100)
committerMark Brown <broonie@linaro.org>
Fri, 20 Sep 2013 16:38:44 +0000 (17:38 +0100)
Now that we are defaulting to providing dummy regulators fix the logic
for substituting a dummy by making the default return code -EPROBE_DEFER.

Reported-by: Thierry Reding <treding@nvidia.com>
Tested-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/regulator/core.c

index ac3a864..088b41a 100644 (file)
@@ -1247,7 +1247,7 @@ static struct regulator *_regulator_get(struct device *dev, const char *id,
        struct regulator_dev *rdev;
        struct regulator *regulator = ERR_PTR(-EPROBE_DEFER);
        const char *devname = NULL;
-       int ret = 0;
+       int ret = -EPROBE_DEFER;
 
        if (id == NULL) {
                pr_err("get() with no identifier\n");