summaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/cpufreq_governor.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-02-07 16:07:51 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-03-09 14:40:54 +0100
commit906a6e5aaef24d3c80bf6a06c794c7541aca64be (patch)
tree2219b7f190959fe04ce8c59a5fca35313ef9f67e /drivers/cpufreq/cpufreq_governor.c
parentcpufreq: governor: Rename some data types and variables (diff)
downloadlinux-906a6e5aaef24d3c80bf6a06c794c7541aca64be.tar.xz
linux-906a6e5aaef24d3c80bf6a06c794c7541aca64be.zip
cpufreq: governor: Rework cpufreq_governor_dbs()
Since it is possible to obtain a pointer to struct dbs_governor from a pointer to the struct governor embedded in it via container_of(), the second argument of cpufreq_governor_init() is not necessary. Accordingly, cpufreq_governor_dbs() doesn't need its second argument either and the ->governor callbacks for both the ondemand and conservative governors may be set to cpufreq_governor_dbs() directly. Make that happen. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Saravana Kannan <skannan@codeaurora.org> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Diffstat (limited to 'drivers/cpufreq/cpufreq_governor.c')
-rw-r--r--drivers/cpufreq/cpufreq_governor.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/cpufreq/cpufreq_governor.c b/drivers/cpufreq/cpufreq_governor.c
index dc5bb298b449..7e579fc42d2a 100644
--- a/drivers/cpufreq/cpufreq_governor.c
+++ b/drivers/cpufreq/cpufreq_governor.c
@@ -328,9 +328,10 @@ static void free_common_dbs_info(struct cpufreq_policy *policy,
kfree(shared);
}
-static int cpufreq_governor_init(struct cpufreq_policy *policy,
- struct dbs_governor *gov)
+static int cpufreq_governor_init(struct cpufreq_policy *policy)
{
+ struct dbs_governor *gov = container_of(policy->governor,
+ struct dbs_governor, gov);
struct dbs_data *dbs_data = gov->gdbs_data;
unsigned int latency;
int ret;
@@ -539,8 +540,7 @@ static int cpufreq_governor_limits(struct cpufreq_policy *policy)
return 0;
}
-int cpufreq_governor_dbs(struct cpufreq_policy *policy,
- struct dbs_governor *gov, unsigned int event)
+int cpufreq_governor_dbs(struct cpufreq_policy *policy, unsigned int event)
{
int ret = -EINVAL;
@@ -548,7 +548,7 @@ int cpufreq_governor_dbs(struct cpufreq_policy *policy,
mutex_lock(&dbs_data_mutex);
if (event == CPUFREQ_GOV_POLICY_INIT) {
- ret = cpufreq_governor_init(policy, gov);
+ ret = cpufreq_governor_init(policy);
} else if (policy->governor_data) {
switch (event) {
case CPUFREQ_GOV_POLICY_EXIT: