From a3b853633d78c3930b513ee219df48637ac82eed Mon Sep 17 00:00:00 2001 From: Thomas Abraham Date: Thu, 30 Jun 2011 21:26:10 +0530 Subject: 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 [grant.likely: some word smithing and be more defensive validating the string] Signed-off-by: Grant Likely --- include/linux/of.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/linux/of.h b/include/linux/of.h index bfc0ed1b0ce..4fc4c1b8d5d 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -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); -- cgit v1.2.3