aboutsummaryrefslogtreecommitdiff
path: root/include/dm/ofnode.h
diff options
context:
space:
mode:
authorSimon Glass2023-09-26 08:14:40 -0600
committerTom Rini2023-10-06 14:38:12 -0400
commite0c3c21d8ba1a0abbb7effee6c5a952f3e65a03d (patch)
tree305d7d79cd9b6776bcccfd3e4911784bff9fa60f /include/dm/ofnode.h
parent9bf78a5add522dfc3f192eb97fb38d829174d6c7 (diff)
dm: core: Add a function to create an empty tree
Provide a function to create a new, empty tree. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/dm/ofnode.h')
-rw-r--r--include/dm/ofnode.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/dm/ofnode.h b/include/dm/ofnode.h
index 32917f66155..0b96ab34ede 100644
--- a/include/dm/ofnode.h
+++ b/include/dm/ofnode.h
@@ -128,6 +128,15 @@ static inline ofnode noffset_to_ofnode(ofnode other_node, int of_offset)
#endif /* OFNODE_MULTI_TREE */
/**
+ * oftree_new() - Create a new, empty tree
+ *
+ * @treep: Returns a pointer to the tree, on success
+ * Returns: 0 on success, -ENOMEM if out of memory, -E2BIG if !OF_LIVE and
+ * there are too many (flattrees) already
+ */
+int oftree_new(oftree *treep);
+
+/**
* ofnode_to_np() - convert an ofnode to a live DT node pointer
*
* This cannot be called if the reference contains an offset.