diff options
Diffstat (limited to 'include/linux/of.h')
-rw-r--r-- | include/linux/of.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/include/linux/of.h b/include/linux/of.h index 4d25e4f952d9..99b0ebf49632 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
@@ -256,6 +256,9 @@ static inline unsigned long of_read_ulong(const __be32 *cell, int size) | |||
256 | #define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags) | 256 | #define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags) |
257 | #define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags) | 257 | #define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags) |
258 | 258 | ||
259 | extern bool of_node_name_eq(const struct device_node *np, const char *name); | ||
260 | extern bool of_node_name_prefix(const struct device_node *np, const char *prefix); | ||
261 | |||
259 | static inline const char *of_node_full_name(const struct device_node *np) | 262 | static inline const char *of_node_full_name(const struct device_node *np) |
260 | { | 263 | { |
261 | return np ? np->full_name : "<no-node>"; | 264 | return np ? np->full_name : "<no-node>"; |
@@ -290,6 +293,8 @@ extern struct device_node *of_get_next_child(const struct device_node *node, | |||
290 | extern struct device_node *of_get_next_available_child( | 293 | extern struct device_node *of_get_next_available_child( |
291 | const struct device_node *node, struct device_node *prev); | 294 | const struct device_node *node, struct device_node *prev); |
292 | 295 | ||
296 | extern struct device_node *of_get_compatible_child(const struct device_node *parent, | ||
297 | const char *compatible); | ||
293 | extern struct device_node *of_get_child_by_name(const struct device_node *node, | 298 | extern struct device_node *of_get_child_by_name(const struct device_node *node, |
294 | const char *name); | 299 | const char *name); |
295 | 300 | ||
@@ -561,6 +566,16 @@ static inline struct device_node *to_of_node(const struct fwnode_handle *fwnode) | |||
561 | return NULL; | 566 | return NULL; |
562 | } | 567 | } |
563 | 568 | ||
569 | static inline bool of_node_name_eq(const struct device_node *np, const char *name) | ||
570 | { | ||
571 | return false; | ||
572 | } | ||
573 | |||
574 | static inline bool of_node_name_prefix(const struct device_node *np, const char *prefix) | ||
575 | { | ||
576 | return false; | ||
577 | } | ||
578 | |||
564 | static inline const char* of_node_full_name(const struct device_node *np) | 579 | static inline const char* of_node_full_name(const struct device_node *np) |
565 | { | 580 | { |
566 | return "<no-node>"; | 581 | return "<no-node>"; |
@@ -632,6 +647,12 @@ static inline bool of_have_populated_dt(void) | |||
632 | return false; | 647 | return false; |
633 | } | 648 | } |
634 | 649 | ||
650 | static inline struct device_node *of_get_compatible_child(const struct device_node *parent, | ||
651 | const char *compatible) | ||
652 | { | ||
653 | return NULL; | ||
654 | } | ||
655 | |||
635 | static inline struct device_node *of_get_child_by_name( | 656 | static inline struct device_node *of_get_child_by_name( |
636 | const struct device_node *node, | 657 | const struct device_node *node, |
637 | const char *name) | 658 | const char *name) |
@@ -967,6 +988,18 @@ static inline struct device_node *of_find_matching_node( | |||
967 | return of_find_matching_node_and_match(from, matches, NULL); | 988 | return of_find_matching_node_and_match(from, matches, NULL); |
968 | } | 989 | } |
969 | 990 | ||
991 | static inline const char *of_node_get_device_type(const struct device_node *np) | ||
992 | { | ||
993 | return of_get_property(np, "type", NULL); | ||
994 | } | ||
995 | |||
996 | static inline bool of_node_is_type(const struct device_node *np, const char *type) | ||
997 | { | ||
998 | const char *match = of_node_get_device_type(np); | ||
999 | |||
1000 | return np && match && type && !strcmp(match, type); | ||
1001 | } | ||
1002 | |||
970 | /** | 1003 | /** |
971 | * of_property_count_u8_elems - Count the number of u8 elements in a property | 1004 | * of_property_count_u8_elems - Count the number of u8 elements in a property |
972 | * | 1005 | * |