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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user