Use build_root_node() instead of open-coding it

build_root_node() does error checking (which is good!) but otherwise
behaves exactly as the code replaced here.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
Uwe Kleine-König 2025-01-13 22:29:11 +01:00 committed by David Gibson
parent 18f4f305fd
commit 175d2a564c

View file

@ -1014,9 +1014,7 @@ static void add_local_fixup_entry(struct dt_info *dti,
/* walk the path components creating nodes if they don't exist */ /* walk the path components creating nodes if they don't exist */
for (wn = lfn, i = 1; i < depth; i++, wn = nwn) { for (wn = lfn, i = 1; i < depth; i++, wn = nwn) {
/* if no node exists, create it */ /* if no node exists, create it */
nwn = get_subnode(wn, compp[i]); nwn = build_root_node(wn, compp[i]);
if (!nwn)
nwn = build_and_name_child_node(wn, compp[i]);
} }
free(compp); free(compp);