]> Pileus Git - ~andy/linux/commitdiff
regulator: core: don't print an error when no regulator is found
authorHans de Goede <hdegoede@redhat.com>
Tue, 17 Dec 2013 15:24:57 +0000 (16:24 +0100)
committerMark Brown <broonie@linaro.org>
Tue, 17 Dec 2013 22:59:15 +0000 (22:59 +0000)
Only print an error when _regulator_get() is expected to return a valid
regulator, that is when _regulator_get() is called from regulator_get() and
we're not using the dummy because we don't have full-constraints, or when
_regulator_get() is called from regulator_get_exclusive() in which case
returning a dummy is not allowed.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/regulator/core.c

index d85f31385b24fe9b68ae45dfe0ece4be0ecc2ceb..9888f26aa131ed15f269225bd927c48dbfb3cfc9 100644 (file)
@@ -1351,7 +1351,8 @@ static struct regulator *_regulator_get(struct device *dev, const char *id,
 
                rdev = dummy_regulator_rdev;
                goto found;
-       } else {
+       /* Don't log an error when called from regulator_get_optional() */
+       } else if (!have_full_constraints() || exclusive) {
                dev_err(dev, "dummy supplies not allowed\n");
        }