diff options
| -rw-r--r-- | include/linux/of.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/of.h b/include/linux/of.h index 688c52dd7b3e..99b0ebf49632 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
| @@ -988,6 +988,18 @@ static inline struct device_node *of_find_matching_node( | |||
| 988 | return of_find_matching_node_and_match(from, matches, NULL); | 988 | return of_find_matching_node_and_match(from, matches, NULL); |
| 989 | } | 989 | } |
| 990 | 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 | |||
| 991 | /** | 1003 | /** |
| 992 | * 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 |
| 993 | * | 1005 | * |
