cpufreq: governor: Pass policy as argument to ->gov_dbs_timer()
authorViresh Kumar <viresh.kumar@linaro.org>
Thu, 3 Dec 2015 04:07:51 +0000 (09:37 +0530)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 7 Dec 2015 01:20:22 +0000 (02:20 +0100)
Pass 'policy' as argument to ->gov_dbs_timer() instead of cdbs and
dbs_data.

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

index 1fa1deb6e91fcbb25b01f8c8e0c23438a0e2bcb4..606ad74abe6e8b248b15a142c4f3fca7241c64be 100644 (file)
@@ -115,13 +115,13 @@ static void cs_check_cpu(int cpu, unsigned int load)
        }
 }
 
-static unsigned int cs_dbs_timer(struct cpu_dbs_info *cdbs,
-                                struct dbs_data *dbs_data, bool modify_all)
+static unsigned int cs_dbs_timer(struct cpufreq_policy *policy, bool modify_all)
 {
+       struct dbs_data *dbs_data = policy->governor_data;
        struct cs_dbs_tuners *cs_tuners = dbs_data->tuners;
 
        if (modify_all)
-               dbs_check_cpu(dbs_data, cdbs->shared->policy->cpu);
+               dbs_check_cpu(dbs_data, policy->cpu);
 
        return delay_for_sampling_rate(cs_tuners->sampling_rate);
 }
index b260576ddb129c9bf485a12a954d0b1db30e08c5..cdcb56a49b287b04af483b35e95b147cdfaf6f16 100644 (file)
@@ -253,7 +253,7 @@ static void dbs_timer(struct work_struct *work)
        if (!need_load_eval(cdbs->shared, sampling_rate))
                modify_all = false;
 
-       delay = dbs_data->cdata->gov_dbs_timer(cdbs, dbs_data, modify_all);
+       delay = dbs_data->cdata->gov_dbs_timer(policy, modify_all);
        gov_queue_work(dbs_data, policy, delay, modify_all);
 
 unlock:
index 5621bb03e874e97415bbd1a790ba98b5737eac65..0c7589016b6c5a81b4d651d1b13b1a21558253f5 100644 (file)
@@ -209,8 +209,7 @@ struct common_dbs_data {
 
        struct cpu_dbs_info *(*get_cpu_cdbs)(int cpu);
        void *(*get_cpu_dbs_info_s)(int cpu);
-       unsigned int (*gov_dbs_timer)(struct cpu_dbs_info *cdbs,
-                                     struct dbs_data *dbs_data,
+       unsigned int (*gov_dbs_timer)(struct cpufreq_policy *policy,
                                      bool modify_all);
        void (*gov_check_cpu)(int cpu, unsigned int load);
        int (*init)(struct dbs_data *dbs_data, bool notify);
index 08f2aa602f9ec98f645a6eebf21e4af3b5b9e726..fc0384b4d02d0de6a5c0d83e56c773625fa4c9d8 100644 (file)
@@ -191,10 +191,9 @@ static void od_check_cpu(int cpu, unsigned int load)
        }
 }
 
-static unsigned int od_dbs_timer(struct cpu_dbs_info *cdbs,
-                                struct dbs_data *dbs_data, bool modify_all)
+static unsigned int od_dbs_timer(struct cpufreq_policy *policy, bool modify_all)
 {
-       struct cpufreq_policy *policy = cdbs->shared->policy;
+       struct dbs_data *dbs_data = policy->governor_data;
        unsigned int cpu = policy->cpu;
        struct od_cpu_dbs_info_s *dbs_info = &per_cpu(od_cpu_dbs_info,
                        cpu);