aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/of.h
diff options
context:
space:
mode:
authorShawn Guo <shawn.guo@linaro.org>2011-07-08 04:27:33 -0400
committerGrant Likely <grant.likely@secretlab.ca>2011-07-08 14:52:33 -0400
commitb98c0239204d6603b3a33bcc2b3916adaa8d4160 (patch)
treedb2c9e80e5c98dcf71c5345198fe55a938628b96 /include/linux/of.h
parent5a9ebe959967b7d3579de2a53d5df470fe0c7f22 (diff)
dt: add empty of_property_read_u32[_array] for non-dt
The patch adds empty functions of_property_read_u32 and of_property_read_u32_array for non-dt build, so that drivers migrating to dt can save some '#ifdef CONFIG_OF'. Signed-off-by: Shawn Guo <shawn.guo@linaro.org> [grant.likely: Moved things around so only one new static inline is needed] [grant.likely: Added _string variant] Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'include/linux/of.h')
-rw-r--r--include/linux/of.h29
1 files changed, 21 insertions, 8 deletions
diff --git a/include/linux/of.h b/include/linux/of.h
index b5f1c88e40a7..bd716f8908de 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -200,13 +200,6 @@ extern int of_property_read_u32_array(const struct device_node *np,
200 u32 *out_values, 200 u32 *out_values,
201 size_t sz); 201 size_t sz);
202 202
203static inline int of_property_read_u32(const struct device_node *np,
204 char *propname,
205 u32 *out_value)
206{
207 return of_property_read_u32_array(np, propname, out_value, 1);
208}
209
210extern int of_property_read_string(struct device_node *np, char *propname, 203extern int of_property_read_string(struct device_node *np, char *propname,
211 const char **out_string); 204 const char **out_string);
212extern int of_device_is_compatible(const struct device_node *device, 205extern int of_device_is_compatible(const struct device_node *device,
@@ -241,12 +234,32 @@ extern void of_attach_node(struct device_node *);
241extern void of_detach_node(struct device_node *); 234extern void of_detach_node(struct device_node *);
242#endif 235#endif
243 236
244#else 237#else /* CONFIG_OF */
245 238
246static inline bool of_have_populated_dt(void) 239static inline bool of_have_populated_dt(void)
247{ 240{
248 return false; 241 return false;
249} 242}
250 243
244static inline int of_property_read_u32_array(const struct device_node *np,
245 char *propname, u32 *out_values, size_t sz)
246{
247 return -ENOSYS;
248}
249
250static inline int of_property_read_string(struct device_node *np,
251 char *propname, const char **out_string)
252{
253 return -ENOSYS;
254}
255
251#endif /* CONFIG_OF */ 256#endif /* CONFIG_OF */
257
258static inline int of_property_read_u32(const struct device_node *np,
259 char *propname,
260 u32 *out_value)
261{
262 return of_property_read_u32_array(np, propname, out_value, 1);
263}
264
252#endif /* _LINUX_OF_H */ 265#endif /* _LINUX_OF_H */