diff options
Diffstat (limited to 'include/linux/of.h')
| -rw-r--r-- | include/linux/of.h | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/include/linux/of.h b/include/linux/of.h index bfc0ed1b0ced..0085bb01c041 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,34 @@ 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 | |||
| 237 | #endif /* CONFIG_OF */ | 259 | #endif /* CONFIG_OF */ |
| 260 | |||
| 261 | static inline int of_property_read_u32(const struct device_node *np, | ||
| 262 | const char *propname, | ||
| 263 | u32 *out_value) | ||
| 264 | { | ||
| 265 | return of_property_read_u32_array(np, propname, out_value, 1); | ||
| 266 | } | ||
| 267 | |||
| 238 | #endif /* _LINUX_OF_H */ | 268 | #endif /* _LINUX_OF_H */ |
