diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2023-04-19 08:59:06 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2023-04-19 08:59:06 +0200 |
commit | 8dd99807baf0b15b74e68e4e66d93bb0fe597621 (patch) | |
tree | b67bf286ffceb440dd5634371d47e63d4f5ec969 /include/of.h | |
parent | c46996d29b49b9d7fc33aa4ae59ea90596da068f (diff) | |
parent | 378c97f9138ab4ec2e1257b4cc70072b459a5361 (diff) | |
download | barebox-8dd99807baf0b15b74e68e4e66d93bb0fe597621.tar.gz |
Merge branch 'for-next/misc'
Diffstat (limited to 'include/of.h')
-rw-r--r-- | include/of.h | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/include/of.h b/include/of.h index 3fb6ecec8d..4b0266fd31 100644 --- a/include/of.h +++ b/include/of.h @@ -152,6 +152,9 @@ extern struct property *__of_new_property(struct device_node *node, extern void of_delete_property(struct property *pp); extern struct property *of_rename_property(struct device_node *np, const char *old_name, const char *new_name); +extern struct property *of_copy_property(const struct device_node *src, + const char *propname, + struct device_node *dst); extern struct device_node *of_find_node_by_name(struct device_node *from, const char *name); @@ -576,6 +579,13 @@ static inline struct property *__of_new_property(struct device_node *node, return NULL; } +static inline struct property *of_copy_property(const struct device_node *src, + const char *propname, + struct device_node *dst) +{ + return NULL; +} + static inline void of_delete_property(struct property *pp) { } @@ -1038,8 +1048,10 @@ static inline int of_property_read_string_index(const struct device_node *np, * @np: device node from which the property value is to be read. * @propname: name of the property to be searched. * - * Search for a property in a device node. - * Returns true if the property exist false otherwise. + * Search for a boolean property in a device node. Usage on non-boolean + * property types is deprecated. + + * Return: true if the property exist false otherwise. */ static inline bool of_property_read_bool(const struct device_node *np, const char *propname) @@ -1049,6 +1061,20 @@ static inline bool of_property_read_bool(const struct device_node *np, return prop ? true : false; } +/** + * of_property_present - Test if a property is present in a node + * @np: device node to search for the property. + * @propname: name of the property to be searched. + * + * Test for a property present in a device node. + * + * Return: true if the property exists false otherwise. + */ +static inline bool of_property_present(const struct device_node *np, const char *propname) +{ + return of_property_read_bool(np, propname); +} + static inline int of_property_read_u8(const struct device_node *np, const char *propname, u8 *out_value) |