summaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/cpufreq_governor.h
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-02-07 16:09:51 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-03-09 14:40:55 +0100
commitea59ee0dc9796a4e879291cc2f4728d04c499313 (patch)
tree6081a8d25c06d43d940280cd2249cb79d3b30524 /drivers/cpufreq/cpufreq_governor.h
parentcpufreq: governor: Rework cpufreq_governor_dbs() (diff)
downloadlinux-ea59ee0dc9796a4e879291cc2f4728d04c499313.tar.xz
linux-ea59ee0dc9796a4e879291cc2f4728d04c499313.zip
cpufreq: governor: Drop the gov pointer from struct dbs_data
Since it is possible to obtain a pointer to struct dbs_governor from a pointer to the struct governor embedded in it with the help of container_of(), the additional gov pointer in struct dbs_data isn't really necessary. Drop that pointer and make the code using it reach the dbs_governor object via policy->governor. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Diffstat (limited to 'drivers/cpufreq/cpufreq_governor.h')
-rw-r--r--drivers/cpufreq/cpufreq_governor.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/cpufreq/cpufreq_governor.h b/drivers/cpufreq/cpufreq_governor.h
index 8e280b8c446a..c8b7ec22871c 100644
--- a/drivers/cpufreq/cpufreq_governor.h
+++ b/drivers/cpufreq/cpufreq_governor.h
@@ -231,9 +231,13 @@ struct dbs_governor {
void *gov_ops;
};
+static inline struct dbs_governor *dbs_governor_of(struct cpufreq_policy *policy)
+{
+ return container_of(policy->governor, struct dbs_governor, gov);
+}
+
/* Governor Per policy data */
struct dbs_data {
- struct dbs_governor *gov;
unsigned int min_sampling_rate;
int usage_count;
void *tuners;
@@ -275,7 +279,7 @@ static ssize_t show_sampling_rate_min_gov_pol \
extern struct mutex dbs_data_mutex;
extern struct mutex cpufreq_governor_lock;
-void dbs_check_cpu(struct dbs_data *dbs_data, int cpu);
+void dbs_check_cpu(struct cpufreq_policy *policy, int cpu);
int cpufreq_governor_dbs(struct cpufreq_policy *policy, unsigned int event);
void od_register_powersave_bias_handler(unsigned int (*f)
(struct cpufreq_policy *, unsigned int, unsigned int),