diff options
author | Marek BehĂșn <marek.behun@nic.cz> | 2021-05-26 14:08:18 +0200 |
---|---|---|
committer | Jagan Teki <jagan@amarulasolutions.com> | 2021-06-24 11:53:00 +0530 |
commit | 0e116bea52af1b665a656d49c328468e976be913 (patch) | |
tree | a14f4bf602e2c3251e70671a8419fab0f8139441 /include/dm/ofnode.h | |
parent | 31a7b719d07ccb11950f423b5f1195375109b5fa (diff) |
dm: core: add ofnode_get_path()
Add function for retrieving full node path of a given ofnode.
This uses np->full_name if OF is live, otherwise a call to
fdt_get_path() is made.
Signed-off-by: Marek BehĂșn <marek.behun@nic.cz>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Tested-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
Diffstat (limited to 'include/dm/ofnode.h')
-rw-r--r-- | include/dm/ofnode.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/dm/ofnode.h b/include/dm/ofnode.h index e3fccb506ea..3da05d8b217 100644 --- a/include/dm/ofnode.h +++ b/include/dm/ofnode.h @@ -459,6 +459,16 @@ ofnode ofnode_get_parent(ofnode node); const char *ofnode_get_name(ofnode node); /** + * ofnode_get_path() - get the full path of a node + * + * @node: valid node to look up + * @buf: buffer to write the node path into + * @buflen: buffer size + * @return 0 if OK, -ve on error + */ +int ofnode_get_path(ofnode node, char *buf, int buflen); + +/** * ofnode_get_by_phandle() - get ofnode from phandle * * @phandle: phandle to look up |