The policy already has this pointer set, use it instead.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
->verify call.
int cpufreq_frequency_table_target(struct cpufreq_policy *policy,
- struct cpufreq_frequency_table *table,
unsigned int target_freq,
unsigned int relation,
unsigned int *index);
unsigned int index;
cpufreq_frequency_table_target(policy,
- policy->freq_table, policy->cur - 1,
- CPUFREQ_RELATION_H, &index);
+ policy->cur - 1, CPUFREQ_RELATION_H, &index);
freq_next = policy->freq_table[index].frequency;
}
return -EINVAL;
}
- retval = cpufreq_frequency_table_target(policy, freq_table, target_freq,
- relation, &index);
+ retval = cpufreq_frequency_table_target(policy, target_freq, relation,
+ &index);
if (unlikely(retval)) {
pr_err("%s: Unable to find matching freq\n", __func__);
return retval;
return freq_next;
}
- cpufreq_frequency_table_target(policy, freq_table, freq_next, relation,
- &index);
+ cpufreq_frequency_table_target(policy, freq_next, relation, &index);
freq_req = freq_table[index].frequency;
freq_reduc = freq_req * od_tuners->powersave_bias / 1000;
freq_avg = freq_req - freq_reduc;
/* Find freq bounds for freq_avg in freq_table */
index = 0;
- cpufreq_frequency_table_target(policy, freq_table, freq_avg,
- CPUFREQ_RELATION_H, &index);
+ cpufreq_frequency_table_target(policy, freq_avg, CPUFREQ_RELATION_H,
+ &index);
freq_lo = freq_table[index].frequency;
index = 0;
- cpufreq_frequency_table_target(policy, freq_table, freq_avg,
- CPUFREQ_RELATION_L, &index);
+ cpufreq_frequency_table_target(policy, freq_avg, CPUFREQ_RELATION_L,
+ &index);
freq_hi = freq_table[index].frequency;
/* Find out how long we have to be in hi and lo freqs */
EXPORT_SYMBOL_GPL(cpufreq_generic_frequency_table_verify);
int cpufreq_frequency_table_target(struct cpufreq_policy *policy,
- struct cpufreq_frequency_table *table,
unsigned int target_freq,
unsigned int relation,
unsigned int *index)
.frequency = 0,
};
struct cpufreq_frequency_table *pos;
+ struct cpufreq_frequency_table *table = policy->freq_table;
unsigned int freq, diff, i = 0;
pr_debug("request for target %u kHz (relation: %u) for cpu %u\n",
struct cpufreq_policy policy;
cpufreq_get_policy(&policy, cpu);
- cpufreq_frequency_table_target(&policy, policy.freq_table,
- policy.cur,
+ cpufreq_frequency_table_target(&policy, policy.cur,
CPUFREQ_RELATION_C, &index);
powernv_cpufreq_target_index(&policy, index);
cpumask_andnot(&mask, &mask, policy.cpus);
__func__, policy, target_freq, relation);
if (ftab) {
- if (cpufreq_frequency_table_target(policy, ftab,
- target_freq, relation,
- &index)) {
+ if (cpufreq_frequency_table_target(policy, target_freq,
+ relation, &index)) {
s3c_freq_dbg("%s: table failed\n", __func__);
return -EINVAL;
}
tmp_policy.min = policy->min * 1000;
tmp_policy.max = policy->max * 1000;
tmp_policy.cpu = policy->cpu;
+ tmp_policy.freq_table = pll_reg;
/* cpufreq_frequency_table_target uses a pointer to 'index'
* which is the number of the table entry, not the value of
* the table entry's index field. */
- ret = cpufreq_frequency_table_target(&tmp_policy, pll_reg,
- target_freq, relation,
- &index);
+ ret = cpufreq_frequency_table_target(&tmp_policy, target_freq,
+ relation, &index);
if (ret < 0) {
pr_err("%s: no PLL available\n", __func__);
new_freq = s5pv210_freq_table[index].frequency;
/* Finding current running level index */
- if (cpufreq_frequency_table_target(policy, s5pv210_freq_table,
- old_freq, CPUFREQ_RELATION_H,
+ if (cpufreq_frequency_table_target(policy, old_freq, CPUFREQ_RELATION_H,
&priv_index)) {
ret = -EINVAL;
goto exit;
int cpufreq_generic_frequency_table_verify(struct cpufreq_policy *policy);
int cpufreq_frequency_table_target(struct cpufreq_policy *policy,
- struct cpufreq_frequency_table *table,
unsigned int target_freq,
unsigned int relation,
unsigned int *index);