[RFC PATCH v2 43/74] dtc: Change fill_fullpaths() signature to take dt_info

From: Herve Codina

Date: Wed Aug 26 2026 - 05:58:27 EST


The future introduction of orphan nodes for addons device-tree will lead
to more than one tree in the addons data. Those trees will be:
- the classical root tree starting at the root node
- trees related to orphan nodes

Also, an addon device-tree can have only trees based on orphan nodes. In
other words an addon device-tree is valid without having the classical
'root' tree.

To prepare orphan nodes introduction, move fill_fullpaths() parameter
one level up and use dt_info struct instead of the 'root' tree (i.e.
dti->dt).

This change doesn't lead to any functional changes.

Signed-off-by: Herve Codina <herve.codina@xxxxxxxxxxx>
---
livetree.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/livetree.c b/livetree.c
index f8abc5d4..a8c7c852 100644
--- a/livetree.c
+++ b/livetree.c
@@ -542,7 +542,7 @@ struct reserve_info *add_reserve_entry(struct reserve_info *list,
return list;
}

-static void fill_fullpaths(struct node *tree, const char *prefix)
+static void fill_fullpaths_(struct node *tree, const char *prefix)
{
struct node *child;
const char *unit;
@@ -556,7 +556,14 @@ static void fill_fullpaths(struct node *tree, const char *prefix)
tree->basenamelen = strlen(tree->name);

for_each_child(tree, child)
- fill_fullpaths(child, tree->fullpath);
+ fill_fullpaths_(child, tree->fullpath);
+}
+
+static void fill_fullpaths(struct dt_info *dti)
+{
+ /* Fill fullpaths for the root node */
+ if (dti->dt)
+ fill_fullpaths_(dti->dt, "");
}

static void complete_ref_and_is_local(struct dt_info *dti, char **ref,
@@ -660,7 +667,7 @@ struct dt_info *build_dt_info(unsigned int dtsflags,
dti->boot_cpuid_phys = boot_cpuid_phys;
dti->importsymlist = importsymlist;

- fill_fullpaths(dti->dt, "");
+ fill_fullpaths(dti);

/*
* Complete references (REF_PHANDLE and export symbols).
--
2.55.0