summaryrefslogtreecommitdiffstats
path: root/include/linux/of.h
diff options
context:
space:
mode:
authorThomas Abraham <thomas.abraham@linaro.org>2011-06-30 21:26:10 +0530
committerGrant Likely <grant.likely@secretlab.ca>2011-06-30 13:02:10 -0600
commita3b853633d78c3930b513ee219df48637ac82eed (patch)
tree30d36c4b3e03db070f72eeaeed3f2d1dd1da159b /include/linux/of.h
parent7423734e19e7e0a90e3379152eacca2647f4377e (diff)
downloadlinux-a3b853633d78c3930b513ee219df48637ac82eed.tar.gz
linux-a3b853633d78c3930b513ee219df48637ac82eed.tar.bz2
linux-a3b853633d78c3930b513ee219df48637ac82eed.zip
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>
Diffstat (limited to 'include/linux/of.h')
-rw-r--r--include/linux/of.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/of.h b/include/linux/of.h
index bfc0ed1b0ced..4fc4c1b8d5d5 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);