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.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/of.h b/include/linux/of.h
index 5c39b9270ff7..b5f33efcb8e2 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -17,6 +17,7 @@
17 */ 17 */
18#include <linux/types.h> 18#include <linux/types.h>
19#include <linux/bitops.h> 19#include <linux/bitops.h>
20#include <linux/mod_devicetable.h>
20 21
21#include <asm/prom.h> 22#include <asm/prom.h>
22 23
@@ -41,11 +42,20 @@ extern struct device_node *of_find_compatible_node(struct device_node *from,
41#define for_each_compatible_node(dn, type, compatible) \ 42#define for_each_compatible_node(dn, type, compatible) \
42 for (dn = of_find_compatible_node(NULL, type, compatible); dn; \ 43 for (dn = of_find_compatible_node(NULL, type, compatible); dn; \
43 dn = of_find_compatible_node(dn, type, compatible)) 44 dn = of_find_compatible_node(dn, type, compatible))
45extern struct device_node *of_find_matching_node(struct device_node *from,
46 const struct of_device_id *matches);
47#define for_each_matching_node(dn, matches) \
48 for (dn = of_find_matching_node(NULL, matches); dn; \
49 dn = of_find_matching_node(dn, matches))
44extern struct device_node *of_find_node_by_path(const char *path); 50extern struct device_node *of_find_node_by_path(const char *path);
45extern struct device_node *of_find_node_by_phandle(phandle handle); 51extern struct device_node *of_find_node_by_phandle(phandle handle);
46extern struct device_node *of_get_parent(const struct device_node *node); 52extern struct device_node *of_get_parent(const struct device_node *node);
47extern struct device_node *of_get_next_child(const struct device_node *node, 53extern struct device_node *of_get_next_child(const struct device_node *node,
48 struct device_node *prev); 54 struct device_node *prev);
55#define for_each_child_of_node(parent, child) \
56 for (child = of_get_next_child(parent, NULL); child != NULL; \
57 child = of_get_next_child(parent, child))
58
49extern struct property *of_find_property(const struct device_node *np, 59extern struct property *of_find_property(const struct device_node *np,
50 const char *name, 60 const char *name,
51 int *lenp); 61 int *lenp);
@@ -56,5 +66,7 @@ extern const void *of_get_property(const struct device_node *node,
56 int *lenp); 66 int *lenp);
57extern int of_n_addr_cells(struct device_node *np); 67extern int of_n_addr_cells(struct device_node *np);
58extern int of_n_size_cells(struct device_node *np); 68extern int of_n_size_cells(struct device_node *np);
69extern const struct of_device_id *of_match_node(
70 const struct of_device_id *matches, const struct device_node *node);
59 71
60#endif /* _LINUX_OF_H */ 72#endif /* _LINUX_OF_H */