aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/of.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/of.h')
-rw-r--r--include/linux/of.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/of.h b/include/linux/of.h
index a367e19bb3af..cad7cf0ab278 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -70,6 +70,11 @@ extern struct device_node *allnodes;
70extern struct device_node *of_chosen; 70extern struct device_node *of_chosen;
71extern rwlock_t devtree_lock; 71extern rwlock_t devtree_lock;
72 72
73static inline bool of_node_is_root(const struct device_node *node)
74{
75 return node && (node->parent == NULL);
76}
77
73static inline int of_node_check_flag(struct device_node *n, unsigned long flag) 78static inline int of_node_check_flag(struct device_node *n, unsigned long flag)
74{ 79{
75 return test_bit(flag, &n->_flags); 80 return test_bit(flag, &n->_flags);
@@ -141,6 +146,11 @@ static inline unsigned long of_read_ulong(const __be32 *cell, int size)
141 146
142#define OF_BAD_ADDR ((u64)-1) 147#define OF_BAD_ADDR ((u64)-1)
143 148
149#ifndef of_node_to_nid
150static inline int of_node_to_nid(struct device_node *np) { return -1; }
151#define of_node_to_nid of_node_to_nid
152#endif
153
144extern struct device_node *of_find_node_by_name(struct device_node *from, 154extern struct device_node *of_find_node_by_name(struct device_node *from,
145 const char *name); 155 const char *name);
146#define for_each_node_by_name(dn, name) \ 156#define for_each_node_by_name(dn, name) \