diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/dm/of_access.h | 15 | ||||
| -rw-r--r-- | include/dm/ofnode.h | 13 |
2 files changed, 28 insertions, 0 deletions
diff --git a/include/dm/of_access.h b/include/dm/of_access.h index d8c6d116433..dd70b44344d 100644 --- a/include/dm/of_access.h +++ b/include/dm/of_access.h @@ -565,4 +565,19 @@ struct device_node *of_get_stdout(void); int of_write_prop(struct device_node *np, const char *propname, int len, const void *value); +/** + * of_add_subnode() - add a new subnode to a node + * + * @node: parent node to add to + * @name: name of subnode + * @len: length of name (so the caller does not need to nul-terminate a + * partial string), or -1 for strlen(@name) + * @subnodep: 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 of_add_subnode(struct device_node *node, const char *name, int len, + struct device_node **subnodep); + #endif diff --git a/include/dm/ofnode.h b/include/dm/ofnode.h index 6414b4648f9..ec1ab0ce15c 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 |
