diff --git a/src/commonlib/device_tree.c b/src/commonlib/device_tree.c index b2daac9cd8..c73e258ccb 100644 --- a/src/commonlib/device_tree.c +++ b/src/commonlib/device_tree.c @@ -1059,12 +1059,13 @@ struct device_tree_node *dt_find_node(struct device_tree_node *parent, { struct device_tree_node *node, *found = NULL; - /* Update #address-cells and #size-cells for this level. */ - dt_read_cell_props(parent, addrcp, sizecp); - if (!*path) return parent; + /* Update #address-cells and #size-cells for the parent level (cells + properties always count for the direct children of their node). */ + dt_read_cell_props(parent, addrcp, sizecp); + /* Find the next node in the path, if it exists. */ list_for_each(node, parent->children, list_node) { if (!strcmp(node->name, *path)) {