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>
This commit is contained in:
Gerald Van Baren
2007-05-21 23:27:16 -04:00
parent 9675ee7208
commit 06e19a0770
2 changed files with 16 additions and 23 deletions

View File

@@ -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;