diff options
author | Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com> | 2013-08-15 09:01:40 -0400 |
---|---|---|
committer | Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com> | 2013-08-21 05:24:44 -0400 |
commit | 183912d352a242a276a7877852f107459a13aff9 (patch) | |
tree | c9f10475a57b92ed1dc7f6c778e8953839955f36 /include/linux/of.h | |
parent | 819d596568d82ffb85b0b5989a1567810fe66098 (diff) |
of: move of_get_cpu_node implementation to DT core library
This patch moves the generalized implementation of of_get_cpu_node from
PowerPC to DT core library, thereby adding support for retrieving cpu
node for a given logical cpu index on any architecture.
The CPU subsystem can now use this function to assign of_node in the
cpu device while registering CPUs.
It is recommended to use these helper function only in pre-SMP/early
initialisation stages to retrieve CPU device node pointers in logical
ordering. Once the cpu devices are registered, it can be retrieved easily
from cpu device of_node which avoids unnecessary parsing and matching.
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Grant Likely <grant.likely@linaro.org>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
Diffstat (limited to 'include/linux/of.h')
-rw-r--r-- | include/linux/of.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/of.h b/include/linux/of.h index 1fd08ca23106..c0bb2f188048 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
@@ -266,6 +266,7 @@ extern int of_device_is_available(const struct device_node *device); | |||
266 | extern const void *of_get_property(const struct device_node *node, | 266 | extern const void *of_get_property(const struct device_node *node, |
267 | const char *name, | 267 | const char *name, |
268 | int *lenp); | 268 | int *lenp); |
269 | extern struct device_node *of_get_cpu_node(int cpu, unsigned int *thread); | ||
269 | #define for_each_property_of_node(dn, pp) \ | 270 | #define for_each_property_of_node(dn, pp) \ |
270 | for (pp = dn->properties; pp != NULL; pp = pp->next) | 271 | for (pp = dn->properties; pp != NULL; pp = pp->next) |
271 | 272 | ||
@@ -459,6 +460,12 @@ static inline const void *of_get_property(const struct device_node *node, | |||
459 | return NULL; | 460 | return NULL; |
460 | } | 461 | } |
461 | 462 | ||
463 | static inline struct device_node *of_get_cpu_node(int cpu, | ||
464 | unsigned int *thread) | ||
465 | { | ||
466 | return NULL; | ||
467 | } | ||
468 | |||
462 | static inline int of_property_read_u64(const struct device_node *np, | 469 | static inline int of_property_read_u64(const struct device_node *np, |
463 | const char *propname, u64 *out_value) | 470 | const char *propname, u64 *out_value) |
464 | { | 471 | { |