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.h33
1 files changed, 16 insertions, 17 deletions
diff --git a/include/linux/of.h b/include/linux/of.h
index ea44fd72af5f..a75a831e2057 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -72,6 +72,20 @@ struct of_phandle_args {
72 uint32_t args[MAX_PHANDLE_ARGS]; 72 uint32_t args[MAX_PHANDLE_ARGS];
73}; 73};
74 74
75#if defined(CONFIG_SPARC) || !defined(CONFIG_OF)
76/* Dummy ref counting routines - to be implemented later */
77static inline struct device_node *of_node_get(struct device_node *node)
78{
79 return node;
80}
81static inline void of_node_put(struct device_node *node)
82{
83}
84#else
85extern struct device_node *of_node_get(struct device_node *node);
86extern void of_node_put(struct device_node *node);
87#endif
88
75#ifdef CONFIG_OF 89#ifdef CONFIG_OF
76 90
77/* Pointer for first entry in chain of all nodes. */ 91/* Pointer for first entry in chain of all nodes. */
@@ -102,21 +116,6 @@ static inline void of_node_set_flag(struct device_node *n, unsigned long flag)
102 116
103extern struct device_node *of_find_all_nodes(struct device_node *prev); 117extern struct device_node *of_find_all_nodes(struct device_node *prev);
104 118
105#if defined(CONFIG_SPARC)
106/* Dummy ref counting routines - to be implemented later */
107static inline struct device_node *of_node_get(struct device_node *node)
108{
109 return node;
110}
111static inline void of_node_put(struct device_node *node)
112{
113}
114
115#else
116extern struct device_node *of_node_get(struct device_node *node);
117extern void of_node_put(struct device_node *node);
118#endif
119
120/* 119/*
121 * OF address retrieval & translation 120 * OF address retrieval & translation
122 */ 121 */
@@ -226,8 +225,8 @@ extern int of_device_is_available(const struct device_node *device);
226extern const void *of_get_property(const struct device_node *node, 225extern const void *of_get_property(const struct device_node *node,
227 const char *name, 226 const char *name,
228 int *lenp); 227 int *lenp);
229#define for_each_property(pp, properties) \ 228#define for_each_property_of_node(dn, pp) \
230 for (pp = properties; pp != NULL; pp = pp->next) 229 for (pp = dn->properties; pp != NULL; pp = pp->next)
231 230
232extern int of_n_addr_cells(struct device_node *np); 231extern int of_n_addr_cells(struct device_node *np);
233extern int of_n_size_cells(struct device_node *np); 232extern int of_n_size_cells(struct device_node *np);