Skip to contentSkip to conversation

clk: show more error info when uclass_get_device_by_name

PATCH New Peng Fan 1 participant 1 message Oct 22, 2019 Common clk

lore
Share & tools
lore

Peng Fan

author
#0 lore raw

PATCH 1/1 clk: show more error info when uclass_get_device_by_name

It will ease debug when uclass_get_device_by_name failed with more error info printed out.

---
 drivers/clk/clk.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/clk/clk.c +4 -2
index 1cf9987f6c..4c477a488e 100644
@@ -20,8 +20,10 @@ int clk_register(struct clk *clk, const char *drv_name,
 	int ret;
 
 	ret = uclass_get_device_by_name(UCLASS_CLK, parent_name, &parent);
-	if (ret)
-		printf("%s: UCLASS parent: 0x%p\n", __func__, parent);
+	if (ret) {
+		printf("%s: name: %s parent: %s [0x%p]\n",
+		       __func__, name, parent->name, parent);
+	}
 
 	debug("%s: name: %s parent: %s [0x%p]\n", __func__, name, parent->name,
 	      parent);
Signature · 1 line
2.16.4