* [PATCH v3] regulator_get_optional: don't print an error when no regulator is found
@ 2013-12-17 15:24 Hans de Goede
2013-12-17 22:21 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Hans de Goede @ 2013-12-17 15:24 UTC (permalink / raw)
To: linux-arm-kernel
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>
---
drivers/regulator/core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index d85f313..9888f26 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -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");
}
--
1.8.4.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-12-17 22:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-17 15:24 [PATCH v3] regulator_get_optional: don't print an error when no regulator is found Hans de Goede
2013-12-17 22:21 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).