linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] regulator_get_optional: don't print an error when no regulator is found
@ 2013-12-12 13:31 Hans de Goede
  0 siblings, 0 replies; only message in thread
From: Hans de Goede @ 2013-12-12 13:31 UTC (permalink / raw)
  To: linux-arm-kernel

Since regulator_get_optional is the only one calling _regulator_get() with
both allow_dummy and exclusive set to false this patch adds the following
test for calling dev_err:

    if (!(!allow_dummy && !exclusive))

Simplified to the much easier on the eyes:

    if (allow_dummy || exclusive)

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 3fe1313..a1d4ddc 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1346,7 +1346,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 (allow_dummy || exclusive) {
 		dev_err(dev, "dummy supplies not allowed\n");
 	}
 
-- 
1.8.4.2

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-12-12 13:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-12 13:31 [PATCH v2] regulator_get_optional: don't print an error when no regulator is found Hans de Goede

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).