diff options
author | Simon Glass <sjg@chromium.org> | 2022-09-07 05:27:24 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-09-30 05:43:43 +0300 |
commit | b7bd94f1a8a63cd4f947036e0d42ee2e23852d64 (patch) | |
tree | cb26f7ac2255dd93940b22859fea9f1b7b34759f /include | |
parent | 2187cb7e4aaae7a4ed7318a073b26dff462cb7a1 (diff) | |
download | u-boot-b7bd94f1a8a63cd4f947036e0d42ee2e23852d64.tar.xz |
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>
Diffstat (limited to 'include')
-rw-r--r-- | include/dm/ofnode.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/include/dm/ofnode.h b/include/dm/ofnode.h index a53cffbed9..ad179a65e9 100644 --- a/include/dm/ofnode.h +++ b/include/dm/ofnode.h @@ -855,18 +855,28 @@ int ofnode_count_phandle_with_args(ofnode node, const char *list_name, ofnode ofnode_path(const char *path); /** - * ofnode_path_root() - find a node by full path from a root node + * oftree_path() - find a node by full path from a root node * * @tree: Device tree to use * @path: Full path to node, e.g. "/bus/spi@1" * Return: reference to the node found. Use ofnode_valid() to check if it exists */ -ofnode ofnode_path_root(oftree tree, const char *path); +ofnode oftree_path(oftree tree, const char *path); + +/** + * oftree_root() - get the root node of a tree + * + * @tree: Device tree to use + * Return: reference to the root node + */ +ofnode oftree_root(oftree tree); /** * ofnode_read_chosen_prop() - get the value of a chosen property * - * This looks for a property within the /chosen node and returns its value + * This looks for a property within the /chosen node and returns its value. + * + * This only works with the control FDT. * * @propname: Property name to look for * @sizep: Returns size of property, or `FDT_ERR_...` error code if function |