dt: add helper functions to read u32 and string property values
Add helper functions to retrieve unsigned integer and string property values from properties of a device node. These helper functions can be used to lookup a property in a device node, perform error checking and read the property value. [grant.likely@secretlab.ca: Proposal and initial implementation] Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org> [grant.likely: some word smithing and be more defensive validating the string] Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
This commit is contained in:
committed by
Grant Likely
parent
7423734e19
commit
a3b853633d
@@ -195,6 +195,10 @@ extern struct device_node *of_find_node_with_property(
|
||||
extern struct property *of_find_property(const struct device_node *np,
|
||||
const char *name,
|
||||
int *lenp);
|
||||
extern int of_property_read_u32(struct device_node *np, char *propname,
|
||||
u32 *out_value);
|
||||
extern int of_property_read_string(struct device_node *np, char *propname,
|
||||
char **out_string);
|
||||
extern int of_device_is_compatible(const struct device_node *device,
|
||||
const char *);
|
||||
extern int of_device_is_available(const struct device_node *device);
|
||||
|
Reference in New Issue
Block a user