From: Mark Brown Date: Fri, 20 Sep 2013 11:23:30 +0000 (+0100) Subject: regulator: core: Fix default return value for _get() X-Git-Tag: next-20130927~40^2~3^2~1 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=9b92da1f1205bd2591487051a93624dd6c258eef;p=karo-tx-linux.git regulator: core: Fix default return value for _get() 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 Tested-by: Thierry Reding Signed-off-by: Mark Brown --- diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index ac3a864d3635..088b41ac9506 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -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");