of: introduce helper to manage boolean
PATCH v4 1/1 of: introduce helper to manage boolean
of_property_read_bool
Search for a property in a device node. Returns true if the property exist false otherwise.
---
v4:
send the right version
include Grant comment
Grant can I get the go please?
Best Regards,
J.
include/linux/of.h | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-)
include/linux/of.h +16 -0
@@ -342,6 +342,22 @@ static inline int of_machine_is_compatible(const char *compat)#define of_match_node (_matches, _node) NULL#endif /* CONFIG_OF */ +/** +* of_property_read_bool - Findfrom a property +* @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. +*/ +static inline bool of_property_read_bool (const struct device_node *np, +const char *propname) +{ +struct property *prop =of_find_property (np, propname,NULL ); + +return prop ? true : false; +} +static inline int of_property_read_u32 (const struct device_node *np,const char *propname,u32 *out_value)
Signature · 1 line
1.7.7
PATCH v4 1/1 of: introduce helper to manage boolean
Quoted 8 lines · Jean-Christophe PLAGNIOL-VILLARD
of_property_read_boolSearch for a property in a device node. Returns true if the property exist false otherwise.
Signed-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>Acked-by Rob Herring <[email protected]>Acked-by Arnd Bergmann <[email protected]>
One comment below; but otherwise:
Feel free to merge via whatever tree needs it.
g.
Quoted 28 lines
Cc Grant Likely <[email protected]>---
v4:send the right version
include Grant comment
Grant can I get the go please?
Best Regards,
J.include/linux/of.h | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-)include/linux/of.h +5
-0@@ -342,6 +342,22 @@ static inline int of_machine_is_compatible(const char *compat)#define of_match_node (_matches, _node) NULL#endif /* CONFIG_OF */ +/** +* of_property_read_bool - Findfrom a property +* @np: device node from which the property value is to be read. +* @propname: name of the property to be searched. +*
include/linux/of.h static inline int of_machine_is_compatible(const char *compat) · line 359
Quoted 10 lines
include/linux/of.h +10
-0+* Search for a property in a device node. +* Returns true if the property exist false otherwise. +*/ +static inline bool of_property_read_bool (const struct device_node *np, +const char *propname) +{ +struct property *prop =of_find_property (np, propname,NULL ); + +return prop ? true : false; +}
Could simply be:
{
return of_find_property(...) != NULL;
}Quoted 7 lines
include/linux/of.h +1
-0+static inline int of_property_read_u32 (const struct device_node *np,const char *propname,u32 *out_value)Signature · 1 line
1.7.7
Signature · 2 lines
Grant Likely, B.Sc, P.Eng. Secret Lab Technologies,Ltd.
PATCH v4 1/1 of: introduce helper to manage boolean
Quoted 58 lines · Grant Likely
Quoted 8 lines · Jean-Christophe PLAGNIOL-VILLARD
of_property_read_boolSearch for a property in a device node. Returns true if the property exist false otherwise.
Signed-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>Acked-by Rob Herring <[email protected]>Acked-by Arnd Bergmann <[email protected]>One comment below; but otherwise:
Acked-by Grant Likely <[email protected]>Feel free to merge via whatever tree needs it.
g.
Quoted 28 lines
Cc Grant Likely <[email protected]>---
v4:send the right version
include Grant comment
Grant can I get the go please?
Best Regards,
J.include/linux/of.h | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-)include/linux/of.h +5
-0@@ -342,6 +342,22 @@ static inline int of_machine_is_compatible(const char *compat)#define of_match_node (_matches, _node) NULL#endif /* CONFIG_OF */ +/** +* of_property_read_bool - Findfrom a property +* @np: device node from which the property value is to be read. +* @propname: name of the property to be searched. +* include/linux/of.h static inline int of_machine_is_compatible(const char *compat) · line 359
Quoted 10 lines
include/linux/of.h +10
-0+* Search for a property in a device node. +* Returns true if the property exist false otherwise. +*/ +static inline bool of_property_read_bool (const struct device_node *np, +const char *propname) +{ +struct property *prop =of_find_property (np, propname,NULL ); + +return prop ? true : false; +}Could simply be:
Quoted 2 lines
{
return of_find_property(...) != NULL;ok fine no preference sned the pull to Arnd with the reset of the DT for at91
please check the USB too I gusee they can go too but maybe for the atmel high-speed device you will have some comment
Best Regards,
J.