Thread (75 messages) flat view 75 messages, 1 author, 26d ago
COLD26d

Revision v2 of 2 in this series.

Revisions (2)
  1. rfc [diff vs current]
  2. v2 current

[RFC PATCH v2 20/74] dtc: Extend complete_references() to handle export symbols

From: Herve Codina <herve.codina@bootlin.com>
Date: 2026-08-26 09:51:45
Also in: lkml
Subsystem: the rest · Maintainer: Linus Torvalds

Export symbols parsed from a .dts or .dtb file suffer from the same
incompleteness as REF_PHANDLE markers. They may lack either the
ref string or the is_local flag depending on the device-tree input
format used.

Apply the same completion operation as the one done for REF_PHANDLE
markers.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
---
 livetree.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/livetree.c b/livetree.c
index 111c651b..8c94e81f 100644
--- a/livetree.c
+++ b/livetree.c
@@ -584,6 +584,7 @@ static void complete_ref_and_is_local(struct dt_info *dti, char **ref,
 
 static void complete_references_internal(struct dt_info *dti, struct node *node)
 {
+	struct symbol *exportsym;
 	struct property *prop;
 	struct marker *m;
 	struct node *c;
@@ -613,6 +614,16 @@ static void complete_references_internal(struct dt_info *dti, struct node *node)
 		}
 	}
 
+	/*
+	 * The exact same behavior exists for export symbols when a dts or a dtb
+	 * is parsed. Perform the exact same completion for export symbols
+	 */
+	for_each_symbol(node->exportsymlist, exportsym) {
+		complete_ref_and_is_local(dti, &exportsym->ref,
+					  &exportsym->is_local,
+					  exportsym->phandle);
+	}
+
 	for_each_child(node, c)
 		complete_references_internal(dti, c);
 }
@@ -637,7 +648,7 @@ struct dt_info *build_dt_info(unsigned int dtsflags,
 	fill_fullpaths(dti->dt, "");
 
 	/*
-	 * Complete references (REF_PHANDLE).
+	 * Complete references (REF_PHANDLE and export symbols).
 	 * Set ref strings and set is_local flags
 	 */
 	complete_references(dti);
-- 
2.55.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help