summaryrefslogtreecommitdiff
path: root/include/linux/of_device.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/of_device.h')
-rw-r--r--include/linux/of_device.h21
1 files changed, 18 insertions, 3 deletions
diff --git a/include/linux/of_device.h b/include/linux/of_device.h
index 901b7435e890..82ce324fdce7 100644
--- a/include/linux/of_device.h
+++ b/include/linux/of_device.h
@@ -1,15 +1,16 @@
#ifndef _LINUX_OF_DEVICE_H
#define _LINUX_OF_DEVICE_H
+#include <linux/cpu.h>
#include <linux/platform_device.h>
#include <linux/of_platform.h> /* temporary until merge */
-#ifdef CONFIG_OF_DEVICE
#include <linux/of.h>
#include <linux/mod_devicetable.h>
struct device;
+#ifdef CONFIG_OF
extern const struct of_device_id *of_match_device(
const struct of_device_id *matches, const struct device *dev);
extern void of_device_make_bus_id(struct device *dev);
@@ -43,7 +44,16 @@ static inline void of_device_node_put(struct device *dev)
of_node_put(dev->of_node);
}
-#else /* CONFIG_OF_DEVICE */
+static inline struct device_node *of_cpu_device_node_get(int cpu)
+{
+ struct device *cpu_dev;
+ cpu_dev = get_cpu_device(cpu);
+ if (!cpu_dev)
+ return NULL;
+ return of_node_get(cpu_dev->of_node);
+}
+
+#else /* CONFIG_OF */
static inline int of_driver_match_device(struct device *dev,
struct device_driver *drv)
@@ -67,6 +77,11 @@ static inline const struct of_device_id *of_match_device(
{
return NULL;
}
-#endif /* CONFIG_OF_DEVICE */
+
+static inline struct device_node *of_cpu_device_node_get(int cpu)
+{
+ return NULL;
+}
+#endif /* CONFIG_OF */
#endif /* _LINUX_OF_DEVICE_H */