dm: core: Add a way to delete a node

Add a function to delete a node in an existing tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2023-09-26 08:14:42 -06:00
committed by Tom Rini
parent c15862ffdd
commit 67fb2159fb
5 changed files with 150 additions and 0 deletions

View File

@@ -1635,4 +1635,17 @@ int ofnode_copy_props(ofnode dst, ofnode src);
int ofnode_copy_node(ofnode dst_parent, const char *name, ofnode src,
ofnode *nodep);
/**
* ofnode_delete() - Delete a node
*
* Delete a node from the tree
*
* @nodep: Pointer to node to delete (set to ofnode_null() on success)
* Return: 0 if OK, -ENOENT if the node does not exist, -EPERM if it is the root
* node (wWhich cannot be removed), -EFAULT if the tree is broken (to_remove is
* not a child of its parent),
*
*/
int ofnode_delete(ofnode *nodep);
#endif