Skip to contentSkip to conversation

regulator_get_optional: don't print an error when no regulator is found

PATCH New Hans de Goede 2 participants 2 messages Dec 17, 2013 Voltage and current regulator framework

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 regulator_get_optional: don't print an error when no regulator is found

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.

---
 drivers/regulator/core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/regulator/core.c +2 -1
index d85f313..9888f26 100644
@@ -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");
 	}
 
Signature · 1 line
1.8.4.2
maintainer
#1 lore raw

PATCH v3 1/1 regulator_get_optional: don't print an error when no regulator is found

Quoted 5 lines · Hans de Goede

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.

Applied, thanks. Please use subject lines that match the pattern for
the subsystem and CC the relevant mailing list (you missed lkml here).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20131217/8c35d1eb/attachment.sig>