Thread (34 messages) 34 messages, 6 authors, 2013-09-10
STALE4642d REVIEWED: 1 (0M)
Revisions (3)
  1. v2 [diff vs current]
  2. v3 [diff vs current]
  3. v4 current

[PATCH v4 07/19] of/device: add helper to get cpu device node from logical cpu index

From: Sudeep KarkadaNagesha <hidden>
Date: 2013-08-20 09:34:34
Also in: linux-arm-kernel, linux-pm, lkml
Subsystem: open firmware and flattened device tree, the rest · Maintainers: Rob Herring, Saravana Kannan, Linus Torvalds

From: Sudeep KarkadaNagesha <redacted>

Multiple drivers need to get the cpu device node from the cpu logical
index and then access the of_node.

This patch adds helper function to fetch the device node directly.

Acked-by: Rob Herring <redacted>
Signed-off-by: Sudeep KarkadaNagesha <redacted>
---
 include/linux/of_device.h | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
diff --git a/include/linux/of_device.h b/include/linux/of_device.h
index 9d27475..82ce324 100644
--- a/include/linux/of_device.h
+++ b/include/linux/of_device.h
@@ -1,6 +1,7 @@
 #ifndef _LINUX_OF_DEVICE_H
 #define _LINUX_OF_DEVICE_H
=20
+#include <linux/cpu.h>
 #include <linux/platform_device.h>
 #include <linux/of_platform.h> /* temporary until merge */
=20
@@ -43,6 +44,15 @@ static inline void of_device_node_put(struct device *dev=
)
 =09of_node_put(dev->of_node);
 }
=20
+static inline struct device_node *of_cpu_device_node_get(int cpu)
+{
+=09struct device *cpu_dev;
+=09cpu_dev =3D get_cpu_device(cpu);
+=09if (!cpu_dev)
+=09=09return NULL;
+=09return of_node_get(cpu_dev->of_node);
+}
+
 #else /* CONFIG_OF */
=20
 static inline int of_driver_match_device(struct device *dev,
@@ -67,6 +77,11 @@ static inline const struct of_device_id *of_match_device=
(
 {
 =09return NULL;
 }
+
+static inline struct device_node *of_cpu_device_node_get(int cpu)
+{
+=09return NULL;
+}
 #endif /* CONFIG_OF */
=20
 #endif /* _LINUX_OF_DEVICE_H */
--=20
1.8.1.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help