Kapil Porwal has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/86030?usp=email )
Change subject: commonlib/dt: Fix incorrect cell properties ......................................................................
commonlib/dt: Fix incorrect cell properties
The function "_dt_find_node" must update cell properties when the input path is NULL because the input node always points to the parent node i.e. the input node is pointing to the last node when the path is NULL.
BUG=none TEST=Test coverage can pass.
Change-Id: I1d360a4cc0a02462a53866bf375e5d4c85177a05 Signed-off-by: Kapil Porwal kapilporwal@google.com --- M src/commonlib/device_tree.c 1 file changed, 3 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/30/86030/1
diff --git a/src/commonlib/device_tree.c b/src/commonlib/device_tree.c index a7007d9..bb3397a 100644 --- a/src/commonlib/device_tree.c +++ b/src/commonlib/device_tree.c @@ -1045,14 +1045,14 @@ { struct device_tree_node *node, *found = NULL;
- 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). */ if (addrcp || sizecp) dt_read_cell_props(parent, addrcp, sizecp);
+ if (!*path) + return parent; + /* Find the next node in the path, if it exists. */ list_for_each(node, parent->children, list_node) { if (!strcmp(node->name, *path)) {