aboutsummaryrefslogtreecommitdiff
path: root/include/dm/of_access.h
diff options
context:
space:
mode:
authorSimon Glass2022-09-06 20:26:57 -0600
committerTom Rini2022-09-29 16:07:58 -0400
commit829d51246fda25655b64224f2a19976797cf1897 (patch)
tree8e74ee7de940010449347df9c7d04ba4afbb551f /include/dm/of_access.h
parentb5001cb4bdfed678877840776c15b1e9a358dacf (diff)
dm: core: Pass a root node to of_find_node_by_phandle()
This function currently assumes that the control FDT is used. Update it to allow a root node to be passed, so it can work with any tree. Also add a comment to ofnode_get_by_phandle() so that its purpose is clear. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/dm/of_access.h')
-rw-r--r--include/dm/of_access.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/dm/of_access.h b/include/dm/of_access.h
index 83f34f0d2ad..d8c6d116433 100644
--- a/include/dm/of_access.h
+++ b/include/dm/of_access.h
@@ -258,11 +258,13 @@ struct device_node *of_find_node_by_prop_value(struct device_node *from,
/**
* of_find_node_by_phandle() - Find a node given a phandle
*
+ * @root: root node to start from (NULL for default device tree)
* @handle: phandle of the node to find
*
* Return: node pointer, or NULL if not found
*/
-struct device_node *of_find_node_by_phandle(phandle handle);
+struct device_node *of_find_node_by_phandle(struct device_node *root,
+ phandle handle);
/**
* of_read_u8() - Find and read a 8-bit integer from a property