aboutsummaryrefslogtreecommitdiff
path: root/include/dm/ofnode.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2022-09-06 20:27:02 -0600
committerTom Rini <trini@konsulko.com>2022-09-29 16:07:58 -0400
commitffe90392497898ccd8000e695901853e192a9007 (patch)
tree0331cda0c368be1cf676f0ea4e8c99e28125b8d0 /include/dm/ofnode.h
parent5ecba3ba40cebd5e4340f6fd422683bde773689c (diff)
downloadu-boot-ffe90392497898ccd8000e695901853e192a9007.zip
u-boot-ffe90392497898ccd8000e695901853e192a9007.tar.gz
u-boot-ffe90392497898ccd8000e695901853e192a9007.tar.bz2
dm: core: Allow adding ofnode subnodes
Add this feature to the ofnode interface, supporting both livetree and flattree. If the node exists it is returned, along with a -EEXIST error. Update the functions it calls to handle this too. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/dm/ofnode.h')
-rw-r--r--include/dm/ofnode.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/dm/ofnode.h b/include/dm/ofnode.h
index 6414b46..ec1ab0c 100644
--- a/include/dm/ofnode.h
+++ b/include/dm/ofnode.h
@@ -1300,6 +1300,19 @@ static inline const char *ofnode_conf_read_str(const char *prop_name)
{
return NULL;
}
+
#endif /* CONFIG_DM */
+/**
+ * of_add_subnode() - add a new subnode to a node
+ *
+ * @parent: parent node to add to
+ * @name: name of subnode
+ * @nodep: returns pointer to new subnode (valid if the function returns 0
+ * or -EEXIST)
+ * Returns 0 if OK, -EEXIST if already exists, -ENOMEM if out of memory, other
+ * -ve on other error
+ */
+int ofnode_add_subnode(ofnode parent, const char *name, ofnode *nodep);
+
#endif