cpufreq: governors: Move get_governor_parent_kobj() to cpufreq.c
authorViresh Kumar <viresh.kumar@linaro.org>
Thu, 16 May 2013 05:09:57 +0000 (05:09 +0000)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 27 May 2013 11:20:56 +0000 (13:20 +0200)
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.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/cpufreq.c
drivers/cpufreq/cpufreq_governor.c
include/linux/cpufreq.h

index 2f254691ed1f1f5e12020b9cd085e6d9eca2cf76..3faf62bdbad0143dd85b576da8a9d3530dda6fe1 100644 (file)
@@ -134,6 +134,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;
index 5af40ad82d231f7fd23bfd862590c30ab7d4b38e..d1421b498c767aaa3876730c9bc37648141aeca9 100644 (file)
 
 #include "cpufreq_governor.h"
 
-static struct kobject *get_governor_parent_kobj(struct cpufreq_policy *policy)
-{
-       if (have_governor_per_policy())
-               return &policy->kobj;
-       else
-               return cpufreq_global_kobject;
-}
-
 static struct attribute_group *get_sysfs_attr(struct dbs_data *dbs_data)
 {
        if (have_governor_per_policy())
index 037d36ae63e52d521def4ef34efeaf327479bcec..dd1a5d41357bc558ca1e57554312a6179203f393 100644 (file)
@@ -340,6 +340,7 @@ const char *cpufreq_get_current_driver(void);
 int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu);
 int cpufreq_update_policy(unsigned int cpu);
 bool have_governor_per_policy(void);
+struct kobject *get_governor_parent_kobj(struct cpufreq_policy *policy);
 
 #ifdef CONFIG_CPU_FREQ
 /* query the current CPU frequency (in kHz). If zero, cpufreq couldn't detect it */