[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1374492747-13879-8-git-send-email-Sudeep.KarkadaNagesha@arm.com>
Date: Mon, 22 Jul 2013 12:32:18 +0100
From: Sudeep KarkadaNagesha <Sudeep.KarkadaNagesha@....com>
To: linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
cpufreq@...r.kernel.org, linux-pm@...r.kernel.org,
devicetree@...r.kernel.org
Cc: Sudeep.KarkadaNagesha@....com,
Russell King <linux@....linux.org.uk>,
Shawn Guo <shawn.guo@...aro.org>,
Gregory Clement <gregory.clement@...e-electrons.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Viresh Kumar <viresh.kumar@...aro.org>,
"Rafael J. Wysocki" <rjw@...k.pl>,
Grant Likely <grant.likely@...aro.org>,
Rob Herring <rob.herring@...xeda.com>,
Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
Olof Johansson <olof@...om.net>, Arnd Bergmann <arnd@...db.de>,
Sudeep KarkadaNagesha <sudeep.karkadanagesha@....com>
Subject: [PATCH v3 07/16] of/device: add helper to get cpu device node from logical cpu index
From: Sudeep KarkadaNagesha <sudeep.karkadanagesha@....com>
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.
Cc: Rob Herring <rob.herring@...xeda.com>
Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@....com>
---
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
+#include <linux/cpu.h>
#include <linux/platform_device.h>
#include <linux/of_platform.h> /* temporary until merge */
@@ -43,6 +44,15 @@ static inline void of_device_node_put(struct device *dev)
of_node_put(dev->of_node);
}
+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,
@@ -67,6 +77,11 @@ static inline const struct of_device_id *of_match_device(
{
return NULL;
}
+
+static inline struct device_node *of_cpu_device_node_get(int cpu)
+{
+ return NULL;
+}
#endif /* CONFIG_OF */
#endif /* _LINUX_OF_DEVICE_H */
--
1.8.1.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists