Commit 7ab4aabb authored by Viresh Kumar's avatar Viresh Kumar Committed by Rafael J. Wysocki

cpufreq: Drop freq-table param to cpufreq_frequency_table_target()

The policy already has this pointer set, use it instead.
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 34ac5d7a
...@@ -244,7 +244,6 @@ policy->max, and all other criteria are met. This is helpful for the ...@@ -244,7 +244,6 @@ policy->max, and all other criteria are met. This is helpful for the
->verify call. ->verify call.
int cpufreq_frequency_table_target(struct cpufreq_policy *policy, int cpufreq_frequency_table_target(struct cpufreq_policy *policy,
struct cpufreq_frequency_table *table,
unsigned int target_freq, unsigned int target_freq,
unsigned int relation, unsigned int relation,
unsigned int *index); unsigned int *index);
......
...@@ -92,8 +92,7 @@ static unsigned int amd_powersave_bias_target(struct cpufreq_policy *policy, ...@@ -92,8 +92,7 @@ static unsigned int amd_powersave_bias_target(struct cpufreq_policy *policy,
unsigned int index; unsigned int index;
cpufreq_frequency_table_target(policy, cpufreq_frequency_table_target(policy,
policy->freq_table, policy->cur - 1, policy->cur - 1, CPUFREQ_RELATION_H, &index);
CPUFREQ_RELATION_H, &index);
freq_next = policy->freq_table[index].frequency; freq_next = policy->freq_table[index].frequency;
} }
......
...@@ -1947,8 +1947,8 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy, ...@@ -1947,8 +1947,8 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy,
return -EINVAL; return -EINVAL;
} }
retval = cpufreq_frequency_table_target(policy, freq_table, target_freq, retval = cpufreq_frequency_table_target(policy, target_freq, relation,
relation, &index); &index);
if (unlikely(retval)) { if (unlikely(retval)) {
pr_err("%s: Unable to find matching freq\n", __func__); pr_err("%s: Unable to find matching freq\n", __func__);
return retval; return retval;
......
...@@ -79,20 +79,19 @@ static unsigned int generic_powersave_bias_target(struct cpufreq_policy *policy, ...@@ -79,20 +79,19 @@ static unsigned int generic_powersave_bias_target(struct cpufreq_policy *policy,
return freq_next; return freq_next;
} }
cpufreq_frequency_table_target(policy, freq_table, freq_next, relation, cpufreq_frequency_table_target(policy, freq_next, relation, &index);
&index);
freq_req = freq_table[index].frequency; freq_req = freq_table[index].frequency;
freq_reduc = freq_req * od_tuners->powersave_bias / 1000; freq_reduc = freq_req * od_tuners->powersave_bias / 1000;
freq_avg = freq_req - freq_reduc; freq_avg = freq_req - freq_reduc;
/* Find freq bounds for freq_avg in freq_table */ /* Find freq bounds for freq_avg in freq_table */
index = 0; index = 0;
cpufreq_frequency_table_target(policy, freq_table, freq_avg, cpufreq_frequency_table_target(policy, freq_avg, CPUFREQ_RELATION_H,
CPUFREQ_RELATION_H, &index); &index);
freq_lo = freq_table[index].frequency; freq_lo = freq_table[index].frequency;
index = 0; index = 0;
cpufreq_frequency_table_target(policy, freq_table, freq_avg, cpufreq_frequency_table_target(policy, freq_avg, CPUFREQ_RELATION_L,
CPUFREQ_RELATION_L, &index); &index);
freq_hi = freq_table[index].frequency; freq_hi = freq_table[index].frequency;
/* Find out how long we have to be in hi and lo freqs */ /* Find out how long we have to be in hi and lo freqs */
......
...@@ -114,7 +114,6 @@ int cpufreq_generic_frequency_table_verify(struct cpufreq_policy *policy) ...@@ -114,7 +114,6 @@ int cpufreq_generic_frequency_table_verify(struct cpufreq_policy *policy)
EXPORT_SYMBOL_GPL(cpufreq_generic_frequency_table_verify); EXPORT_SYMBOL_GPL(cpufreq_generic_frequency_table_verify);
int cpufreq_frequency_table_target(struct cpufreq_policy *policy, int cpufreq_frequency_table_target(struct cpufreq_policy *policy,
struct cpufreq_frequency_table *table,
unsigned int target_freq, unsigned int target_freq,
unsigned int relation, unsigned int relation,
unsigned int *index) unsigned int *index)
...@@ -128,6 +127,7 @@ int cpufreq_frequency_table_target(struct cpufreq_policy *policy, ...@@ -128,6 +127,7 @@ int cpufreq_frequency_table_target(struct cpufreq_policy *policy,
.frequency = 0, .frequency = 0,
}; };
struct cpufreq_frequency_table *pos; struct cpufreq_frequency_table *pos;
struct cpufreq_frequency_table *table = policy->freq_table;
unsigned int freq, diff, i = 0; unsigned int freq, diff, i = 0;
pr_debug("request for target %u kHz (relation: %u) for cpu %u\n", pr_debug("request for target %u kHz (relation: %u) for cpu %u\n",
......
...@@ -760,8 +760,7 @@ void powernv_cpufreq_work_fn(struct work_struct *work) ...@@ -760,8 +760,7 @@ void powernv_cpufreq_work_fn(struct work_struct *work)
struct cpufreq_policy policy; struct cpufreq_policy policy;
cpufreq_get_policy(&policy, cpu); cpufreq_get_policy(&policy, cpu);
cpufreq_frequency_table_target(&policy, policy.freq_table, cpufreq_frequency_table_target(&policy, policy.cur,
policy.cur,
CPUFREQ_RELATION_C, &index); CPUFREQ_RELATION_C, &index);
powernv_cpufreq_target_index(&policy, index); powernv_cpufreq_target_index(&policy, index);
cpumask_andnot(&mask, &mask, policy.cpus); cpumask_andnot(&mask, &mask, policy.cpus);
......
...@@ -293,9 +293,8 @@ static int s3c_cpufreq_target(struct cpufreq_policy *policy, ...@@ -293,9 +293,8 @@ static int s3c_cpufreq_target(struct cpufreq_policy *policy,
__func__, policy, target_freq, relation); __func__, policy, target_freq, relation);
if (ftab) { if (ftab) {
if (cpufreq_frequency_table_target(policy, ftab, if (cpufreq_frequency_table_target(policy, target_freq,
target_freq, relation, relation, &index)) {
&index)) {
s3c_freq_dbg("%s: table failed\n", __func__); s3c_freq_dbg("%s: table failed\n", __func__);
return -EINVAL; return -EINVAL;
} }
...@@ -323,14 +322,14 @@ static int s3c_cpufreq_target(struct cpufreq_policy *policy, ...@@ -323,14 +322,14 @@ static int s3c_cpufreq_target(struct cpufreq_policy *policy,
tmp_policy.min = policy->min * 1000; tmp_policy.min = policy->min * 1000;
tmp_policy.max = policy->max * 1000; tmp_policy.max = policy->max * 1000;
tmp_policy.cpu = policy->cpu; tmp_policy.cpu = policy->cpu;
tmp_policy.freq_table = pll_reg;
/* cpufreq_frequency_table_target uses a pointer to 'index' /* cpufreq_frequency_table_target uses a pointer to 'index'
* which is the number of the table entry, not the value of * which is the number of the table entry, not the value of
* the table entry's index field. */ * the table entry's index field. */
ret = cpufreq_frequency_table_target(&tmp_policy, pll_reg, ret = cpufreq_frequency_table_target(&tmp_policy, target_freq,
target_freq, relation, relation, &index);
&index);
if (ret < 0) { if (ret < 0) {
pr_err("%s: no PLL available\n", __func__); pr_err("%s: no PLL available\n", __func__);
......
...@@ -246,8 +246,7 @@ static int s5pv210_target(struct cpufreq_policy *policy, unsigned int index) ...@@ -246,8 +246,7 @@ static int s5pv210_target(struct cpufreq_policy *policy, unsigned int index)
new_freq = s5pv210_freq_table[index].frequency; new_freq = s5pv210_freq_table[index].frequency;
/* Finding current running level index */ /* Finding current running level index */
if (cpufreq_frequency_table_target(policy, s5pv210_freq_table, if (cpufreq_frequency_table_target(policy, old_freq, CPUFREQ_RELATION_H,
old_freq, CPUFREQ_RELATION_H,
&priv_index)) { &priv_index)) {
ret = -EINVAL; ret = -EINVAL;
goto exit; goto exit;
......
...@@ -598,7 +598,6 @@ int cpufreq_frequency_table_verify(struct cpufreq_policy *policy, ...@@ -598,7 +598,6 @@ int cpufreq_frequency_table_verify(struct cpufreq_policy *policy,
int cpufreq_generic_frequency_table_verify(struct cpufreq_policy *policy); int cpufreq_generic_frequency_table_verify(struct cpufreq_policy *policy);
int cpufreq_frequency_table_target(struct cpufreq_policy *policy, int cpufreq_frequency_table_target(struct cpufreq_policy *policy,
struct cpufreq_frequency_table *table,
unsigned int target_freq, unsigned int target_freq,
unsigned int relation, unsigned int relation,
unsigned int *index); unsigned int *index);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment