[DT-OVERLAY PATCH] of: overlay: print the offending node name on fixup failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When a DT overlay has a fixup node that is not present in the base DT
__symbols__, this error is printed:

  OF: resolver: overlay phandle fixup failed: -22
  create_overlay: Failed to create overlay (err=-22)

which does not help much in finding the node that caused the problem.

Add a debug print with the name of the fixup node that caused the
error. The new output is:

  OF: resolver: node gpio9 not found in base DT, fixup failed
  OF: resolver: overlay phandle fixup failed: -22
  create_overlay: Failed to create overlay (err=-22)

Signed-off-by: Luca Ceresoli <luca@xxxxxxxxxxxxxxxx>

---

NOTE: this patch is not for mainline!

It applies on top of the runtime overlay patches at
git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git on
branch topic/overlays, currently based on v5.6-rc1. This looked like the
most up-to-date version of the overlay patches. Should there be a better
place, please let me know.
---
 drivers/of/resolver.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/of/resolver.c b/drivers/of/resolver.c
index 83c766233181..ade817407b78 100644
--- a/drivers/of/resolver.c
+++ b/drivers/of/resolver.c
@@ -321,8 +321,11 @@ int of_resolve_phandles(struct device_node *overlay)
 
 		err = of_property_read_string(tree_symbols,
 				prop->name, &refpath);
-		if (err)
+		if (err) {
+			pr_err("node %s not found in base DT, fixup failed",
+			       prop->name);
 			goto out;
+		}
 
 		refnode = of_find_node_by_path(refpath);
 		if (!refnode) {
-- 
2.25.0




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux