Skip to contentSkip to conversation

regulator: Fix up a confusing dev_warn when regulator_get fails

PATCH Applied Rajendra Nayak 2 participants 2 messages Mar 16, 2012 Voltage and current regulator framework

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 regulator: Fix up a confusing dev_warn when regulator_get fails

of_parse_phandle() returns NULL either if the property name itself does not exist or if it (exists and) does not reference a valid phandle.
Giving out a warn like the one below (that the property references an invalid phandle) can be confusing when the property itself does not exist in the node.
Fix it with a more sensible message and make it a dev_dbg instead of a dev_warn.

---
 drivers/regulator/core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/regulator/core.c +1 -1
index 5a6b8ba..e2f3afa 100644
@@ -148,7 +148,7 @@ static struct device_node *of_get_regulator(struct device *dev, const char *supp
 	regnode = of_parse_phandle(dev->of_node, prop_name, 0);
 
 	if (!regnode) {
-		dev_warn(dev, "%s property in node %s references invalid phandle",
+		dev_dbg(dev, "Looking up %s property in node %s failed",
 				prop_name, dev->of_node->full_name);
 		return NULL;
 	}
Signature · 1 line
1.7.1
Applied
#1 lore raw
Quoted 3 lines · Rajendra Nayak

of_parse_phandle() returns NULL either if the property name itself does not exist or if it (exists and) does not reference a valid phandle.

Applied, thanks (tweaked the subject line to say DT instead).