aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/libfdt_env.h1
-rw-r--r--include/linux/of.h19
2 files changed, 13 insertions, 7 deletions
diff --git a/include/linux/libfdt_env.h b/include/linux/libfdt_env.h
index c6ac1fe7ec68..edb0f0c30904 100644
--- a/include/linux/libfdt_env.h
+++ b/include/linux/libfdt_env.h
@@ -2,6 +2,7 @@
2#ifndef LIBFDT_ENV_H 2#ifndef LIBFDT_ENV_H
3#define LIBFDT_ENV_H 3#define LIBFDT_ENV_H
4 4
5#include <linux/kernel.h> /* For INT_MAX */
5#include <linux/string.h> 6#include <linux/string.h>
6 7
7#include <asm/byteorder.h> 8#include <asm/byteorder.h>
diff --git a/include/linux/of.h b/include/linux/of.h
index bf577ca3c8e7..ab96025b2382 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -247,12 +247,6 @@ static inline unsigned long of_read_ulong(const __be32 *cell, int size)
247#include <asm/prom.h> 247#include <asm/prom.h>
248#endif 248#endif
249 249
250/* Default #address and #size cells. Allow arch asm/prom.h to override */
251#if !defined(OF_ROOT_NODE_ADDR_CELLS_DEFAULT)
252#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 1
253#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1
254#endif
255
256#define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags) 250#define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags)
257#define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags) 251#define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags)
258 252
@@ -353,6 +347,8 @@ extern const void *of_get_property(const struct device_node *node,
353 const char *name, 347 const char *name,
354 int *lenp); 348 int *lenp);
355extern struct device_node *of_get_cpu_node(int cpu, unsigned int *thread); 349extern struct device_node *of_get_cpu_node(int cpu, unsigned int *thread);
350extern struct device_node *of_get_next_cpu_node(struct device_node *prev);
351
356#define for_each_property_of_node(dn, pp) \ 352#define for_each_property_of_node(dn, pp) \
357 for (pp = dn->properties; pp != NULL; pp = pp->next) 353 for (pp = dn->properties; pp != NULL; pp = pp->next)
358 354
@@ -758,6 +754,11 @@ static inline struct device_node *of_get_cpu_node(int cpu,
758 return NULL; 754 return NULL;
759} 755}
760 756
757static inline struct device_node *of_get_next_cpu_node(struct device_node *prev)
758{
759 return NULL;
760}
761
761static inline int of_n_addr_cells(struct device_node *np) 762static inline int of_n_addr_cells(struct device_node *np)
762{ 763{
763 return 0; 764 return 0;
@@ -1001,7 +1002,7 @@ static inline struct device_node *of_find_matching_node(
1001 1002
1002static inline const char *of_node_get_device_type(const struct device_node *np) 1003static inline const char *of_node_get_device_type(const struct device_node *np)
1003{ 1004{
1004 return of_get_property(np, "type", NULL); 1005 return of_get_property(np, "device_type", NULL);
1005} 1006}
1006 1007
1007static inline bool of_node_is_type(const struct device_node *np, const char *type) 1008static inline bool of_node_is_type(const struct device_node *np, const char *type)
@@ -1228,6 +1229,10 @@ static inline int of_property_read_s32(const struct device_node *np,
1228 for (child = of_get_next_available_child(parent, NULL); child != NULL; \ 1229 for (child = of_get_next_available_child(parent, NULL); child != NULL; \
1229 child = of_get_next_available_child(parent, child)) 1230 child = of_get_next_available_child(parent, child))
1230 1231
1232#define for_each_of_cpu_node(cpu) \
1233 for (cpu = of_get_next_cpu_node(NULL); cpu != NULL; \
1234 cpu = of_get_next_cpu_node(cpu))
1235
1231#define for_each_node_with_property(dn, prop_name) \ 1236#define for_each_node_with_property(dn, prop_name) \
1232 for (dn = of_find_node_with_property(NULL, prop_name); dn; \ 1237 for (dn = of_find_node_with_property(NULL, prop_name); dn; \
1233 dn = of_find_node_with_property(dn, prop_name)) 1238 dn = of_find_node_with_property(dn, prop_name))