summaryrefslogtreecommitdiff
path: root/include/linux/of.h
diff options
context:
space:
mode:
authorRob Herring <rob.herring@calxeda.com>2011-07-07 00:42:58 +0400
committerGrant Likely <grant.likely@secretlab.ca>2011-07-07 00:58:09 +0400
commit0e373639ad7c7ef2b0c9cf907574b266791b9778 (patch)
tree2600fab3cee4360311a3e0784aa2498dc9cceb6a /include/linux/of.h
parentb84e773119e1401e6ebd8906fb0b2a43bbe64871 (diff)
downloadlinux-0e373639ad7c7ef2b0c9cf907574b266791b9778.tar.xz
dt: add helper function to read u32 arrays
Rework of_property_read_u32 to read an array of values. Then of_property_read_u32 becomes an inline with array size of 1. Also make struct device_node ptr const. Signed-off-by: Rob Herring <rob.herring@calxeda.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'include/linux/of.h')
-rw-r--r--include/linux/of.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/include/linux/of.h b/include/linux/of.h
index b23852002b30..b5f1c88e40a7 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -195,8 +195,18 @@ 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_u32_array(const struct device_node *np,
+ char *propname,
+ u32 *out_values,
+ size_t sz);
+
+static inline int of_property_read_u32(const struct device_node *np,
+ char *propname,
+ u32 *out_value)
+{
+ return of_property_read_u32_array(np, propname, out_value, 1);
+}
+
extern int of_property_read_string(struct device_node *np, char *propname,
const char **out_string);
extern int of_device_is_compatible(const struct device_node *device,