summaryrefslogtreecommitdiff
path: root/drivers/cpufreq/cpufreq.c
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2013-05-13 16:26:48 +0530
committerBharat Nihalani <bnihalani@nvidia.com>2013-09-25 00:36:25 -0700
commit4cd3c66e17f458d849e9cb98f06bb2dc48c81be8 (patch)
tree759e7e066a08619c20dfcb135abf7ab8e0f839b9 /drivers/cpufreq/cpufreq.c
parentacc478dedf338cd975122edcaef7adae563dea87 (diff)
cpufreq: governors: Move get_governor_parent_kobj() to cpufreq.c
get_governor_parent_kobj() can be used by any governor, generic cpufreq governors or platform specific ones and so must be present in cpufreq.c instead of cpufreq_governor.c. This patch moves it to cpufreq.c. This also adds EXPORT_SYMBOL_GPL(get_governor_parent_kobj) so that modules can use this function too. Bug 1367411 Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> (cherry picked from commit 69bbfa930a4b93beae124e10566d37d1ab3d07af) Signed-off-by: Shridhar Rasal <srasal@nvidia.com> Change-Id: I5d5efb998321c939667189920698685d749da59d Reviewed-on: http://git-master/r/276654 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Shridhar Rasal <srasal@nvidia.com> Tested-by: Shridhar Rasal <srasal@nvidia.com> Reviewed-by: Puneet Saxena <puneets@nvidia.com> Tested-by: Puneet Saxena <puneets@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'drivers/cpufreq/cpufreq.c')
-rw-r--r--drivers/cpufreq/cpufreq.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index e3c38447d5dc..9d07c5e0115e 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -136,6 +136,15 @@ bool have_governor_per_policy(void)
}
EXPORT_SYMBOL_GPL(have_governor_per_policy);
+struct kobject *get_governor_parent_kobj(struct cpufreq_policy *policy)
+{
+ if (have_governor_per_policy())
+ return &policy->kobj;
+ else
+ return cpufreq_global_kobject;
+}
+EXPORT_SYMBOL_GPL(get_governor_parent_kobj);
+
static struct cpufreq_policy *__cpufreq_cpu_get(unsigned int cpu, bool sysfs)
{
struct cpufreq_policy *data;