diff options
Diffstat (limited to 'include/linux/of.h')
-rw-r--r-- | include/linux/of.h | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/include/linux/of.h b/include/linux/of.h index bfc0ed1b0ced..9180dc5cb00b 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
@@ -195,6 +195,14 @@ extern struct device_node *of_find_node_with_property( | |||
195 | extern struct property *of_find_property(const struct device_node *np, | 195 | extern struct property *of_find_property(const struct device_node *np, |
196 | const char *name, | 196 | const char *name, |
197 | int *lenp); | 197 | int *lenp); |
198 | extern int of_property_read_u32_array(const struct device_node *np, | ||
199 | const char *propname, | ||
200 | u32 *out_values, | ||
201 | size_t sz); | ||
202 | |||
203 | extern int of_property_read_string(struct device_node *np, | ||
204 | const char *propname, | ||
205 | const char **out_string); | ||
198 | extern int of_device_is_compatible(const struct device_node *device, | 206 | extern int of_device_is_compatible(const struct device_node *device, |
199 | const char *); | 207 | const char *); |
200 | extern int of_device_is_available(const struct device_node *device); | 208 | extern int of_device_is_available(const struct device_node *device); |
@@ -227,12 +235,41 @@ extern void of_attach_node(struct device_node *); | |||
227 | extern void of_detach_node(struct device_node *); | 235 | extern void of_detach_node(struct device_node *); |
228 | #endif | 236 | #endif |
229 | 237 | ||
230 | #else | 238 | #else /* CONFIG_OF */ |
231 | 239 | ||
232 | static inline bool of_have_populated_dt(void) | 240 | static inline bool of_have_populated_dt(void) |
233 | { | 241 | { |
234 | return false; | 242 | return false; |
235 | } | 243 | } |
236 | 244 | ||
245 | static inline int of_property_read_u32_array(const struct device_node *np, | ||
246 | const char *propname, | ||
247 | u32 *out_values, size_t sz) | ||
248 | { | ||
249 | return -ENOSYS; | ||
250 | } | ||
251 | |||
252 | static inline int of_property_read_string(struct device_node *np, | ||
253 | const char *propname, | ||
254 | const char **out_string) | ||
255 | { | ||
256 | return -ENOSYS; | ||
257 | } | ||
258 | |||
259 | static inline const void *of_get_property(const struct device_node *node, | ||
260 | const char *name, | ||
261 | int *lenp) | ||
262 | { | ||
263 | return NULL; | ||
264 | } | ||
265 | |||
237 | #endif /* CONFIG_OF */ | 266 | #endif /* CONFIG_OF */ |
267 | |||
268 | static inline int of_property_read_u32(const struct device_node *np, | ||
269 | const char *propname, | ||
270 | u32 *out_value) | ||
271 | { | ||
272 | return of_property_read_u32_array(np, propname, out_value, 1); | ||
273 | } | ||
274 | |||
238 | #endif /* _LINUX_OF_H */ | 275 | #endif /* _LINUX_OF_H */ |