For fdt_find_node_by_path(), handle the root path properly.
Also removes the special case root path detection in cmd_fdt.c since it
is no longer necessary.
Signed-off-by: Gerald Van Baren <vanbaren@cideas.com>
diff --git a/libfdt/fdt_ro.c b/libfdt/fdt_ro.c
index 923c389..ffd9209 100644
--- a/libfdt/fdt_ro.c
+++ b/libfdt/fdt_ro.c
@@ -283,6 +283,10 @@
if (*path != '/')
return -FDT_ERR_BADPATH;
+ /* Handle the root path: root offset is 0 */
+ if (strcmp(path, "/") == 0)
+ return 0;
+
while (*p) {
const char *q;