dm: core: Split ofnode_path_root() into two functions

This function turns out to be a little confusing since it looks up a path
and also registers the tree. Split it into two, one that gets the root
node and one that looks up a path, so the purpose is clear.

Registering the tree will happen in a function to be added in a later
patch, called oftree_from_fdt().

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2022-09-06 20:27:24 -06:00
committed by Tom Rini
parent 2187cb7e4a
commit b7bd94f1a8
5 changed files with 55 additions and 13 deletions

View File

@@ -96,7 +96,7 @@ static int vbe_simple_test_base(struct unit_test_state *uts)
fixup.tree.np = np;
ut_assertok(event_notify(EVT_FT_FIXUP, &fixup, sizeof(fixup)));
node = ofnode_path_root(fixup.tree, "/chosen/fwupd/firmware0");
node = oftree_path(fixup.tree, "/chosen/fwupd/firmware0");
version = ofnode_read_string(node, "cur-version");
ut_assertnonnull(version);