summaryrefslogtreecommitdiff
path: root/drivers/core
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2022-09-07 05:27:15 +0300
committerTom Rini <trini@konsulko.com>2022-09-29 23:11:14 +0300
commitf46ec93ed593e7a442629a2a56fd541debc41329 (patch)
tree3992b6252e60c9fccd1661c9ef81f4d1e694c55d /drivers/core
parent9243224687bd92674c693546a46f849b1a54c75c (diff)
downloadu-boot-f46ec93ed593e7a442629a2a56fd541debc41329.tar.xz
dm: core: Avoid creating a name property when unflattening
The current implementation creates a 'name' value for every node. This is not needed for the latest device tree format, which includes a name in the node header. Adjust the code to point the name at the node header instead. Also simplify ofnode_get_name(), now that we can rely on it to set the name correctly. Update the comment to make it clear what name the root node has. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/core')
-rw-r--r--drivers/core/ofnode.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/core/ofnode.c b/drivers/core/ofnode.c
index f9c9ca14a6..154c7b2667 100644
--- a/drivers/core/ofnode.c
+++ b/drivers/core/ofnode.c
@@ -356,7 +356,7 @@ const char *ofnode_get_name(ofnode node)
}
if (ofnode_is_np(node))
- return strrchr(node.np->full_name, '/') + 1;
+ return node.np->name;
return fdt_get_name(gd->fdt_blob, ofnode_to_offset(node), NULL);
}