diff options
author | Simon Glass <sjg@chromium.org> | 2022-09-06 20:27:33 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-09-29 22:43:43 -0400 |
commit | db1ef1e12b993275e09f116ebc3d23d675c7e28c (patch) | |
tree | 2a1798758c85d3010640cf6bacb1ad7caaa29133 /include/dm/ofnode.h | |
parent | 0b58eaa89c4d7a4aea1f7f63ff4aca2c2f1d90c4 (diff) |
dm: core: Support copying properties with ofnode
Add a function to copy properties from one node to another.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/dm/ofnode.h')
-rw-r--r-- | include/dm/ofnode.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/dm/ofnode.h b/include/dm/ofnode.h index 5203045a58e..7aae2c29ef1 100644 --- a/include/dm/ofnode.h +++ b/include/dm/ofnode.h @@ -1505,4 +1505,20 @@ static inline const char *ofnode_conf_read_str(const char *prop_name) */ int ofnode_add_subnode(ofnode parent, const char *name, ofnode *nodep); +/** + * ofnode_copy_props() - copy all properties from one node to another + * + * Makes a copy of all properties from the source note in the destination node. + * Existing properties in the destination node remain unchanged, except that + * any with the same name are overwritten, including changing the size of the + * property. + * + * For livetree, properties are copied / allocated, so the source tree does not + * need to be present afterwards. + * + * @src: Source node to read properties from + * @dst: Destination node to write properties too + */ +int ofnode_copy_props(ofnode src, ofnode dst); + #endif |