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>
diff --git a/include/dm/ofnode.h b/include/dm/ofnode.h
index 32917f6..0b96ab3 100644
--- a/include/dm/ofnode.h
+++ b/include/dm/ofnode.h
@@ -128,6 +128,15 @@
 #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.