diff options
author | Gerald Van Baren | 2007-05-21 23:27:16 -0400 |
---|---|---|
committer | Gerald Van Baren | 2007-08-10 19:21:36 -0400 |
commit | 06e19a07701c968f15d72c083b5872a1a11c7b01 (patch) | |
tree | e2a263a8a1e2002fc0353fa446f4aee746e43cf0 /libfdt/fdt_ro.c | |
parent | 9675ee7208ab965d13ea8d8262d77ac4160ef549 (diff) |
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>
Diffstat (limited to 'libfdt/fdt_ro.c')
-rw-r--r-- | libfdt/fdt_ro.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libfdt/fdt_ro.c b/libfdt/fdt_ro.c index 923c389ece9..ffd9209b193 100644 --- a/libfdt/fdt_ro.c +++ b/libfdt/fdt_ro.c @@ -283,6 +283,10 @@ int fdt_find_node_by_path(const void *fdt, const char *path) 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; |