diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2016-06-03 01:28:49 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2016-06-08 18:58:06 -0400 |
commit | 7ab4aabbaa98fbf9f8967fd93162d675439337e1 (patch) | |
tree | 4eb068b0c8be0e37dd3be69fbcbfe1d506382056 /drivers/cpufreq | |
parent | 34ac5d7a1d1da203008697e1a69cb4bdbff8684c (diff) |
cpufreq: Drop freq-table param to cpufreq_frequency_table_target()
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>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r-- | drivers/cpufreq/amd_freq_sensitivity.c | 3 | ||||
-rw-r--r-- | drivers/cpufreq/cpufreq.c | 4 | ||||
-rw-r--r-- | drivers/cpufreq/cpufreq_ondemand.c | 11 | ||||
-rw-r--r-- | drivers/cpufreq/freq_table.c | 2 | ||||
-rw-r--r-- | drivers/cpufreq/powernv-cpufreq.c | 3 | ||||
-rw-r--r-- | drivers/cpufreq/s3c24xx-cpufreq.c | 11 | ||||
-rw-r--r-- | drivers/cpufreq/s5pv210-cpufreq.c | 3 |
7 files changed, 16 insertions, 21 deletions
diff --git a/drivers/cpufreq/amd_freq_sensitivity.c b/drivers/cpufreq/amd_freq_sensitivity.c index bc86816693a8..3bea1bb791a9 100644 --- a/drivers/cpufreq/amd_freq_sensitivity.c +++ b/drivers/cpufreq/amd_freq_sensitivity.c | |||
@@ -92,8 +92,7 @@ static unsigned int amd_powersave_bias_target(struct cpufreq_policy *policy, | |||
92 | unsigned int index; | 92 | unsigned int index; |
93 | 93 | ||
94 | cpufreq_frequency_table_target(policy, | 94 | cpufreq_frequency_table_target(policy, |
95 | policy->freq_table, policy->cur - 1, | 95 | policy->cur - 1, CPUFREQ_RELATION_H, &index); |
96 | CPUFREQ_RELATION_H, &index); | ||
97 | freq_next = policy->freq_table[index].frequency; | 96 | freq_next = policy->freq_table[index].frequency; |
98 | } | 97 | } |
99 | 98 | ||
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index cc252eecc45a..a28144697128 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
@@ -1947,8 +1947,8 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy, | |||
1947 | return -EINVAL; | 1947 | return -EINVAL; |
1948 | } | 1948 | } |
1949 | 1949 | ||
1950 | retval = cpufreq_frequency_table_target(policy, freq_table, target_freq, | 1950 | retval = cpufreq_frequency_table_target(policy, target_freq, relation, |
1951 | relation, &index); | 1951 | &index); |
1952 | if (unlikely(retval)) { | 1952 | if (unlikely(retval)) { |
1953 | pr_err("%s: Unable to find matching freq\n", __func__); | 1953 | pr_err("%s: Unable to find matching freq\n", __func__); |
1954 | return retval; | 1954 | return retval; |
diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c index 528353f204fd..2ee476f5a2bd 100644 --- a/drivers/cpufreq/cpufreq_ondemand.c +++ b/drivers/cpufreq/cpufreq_ondemand.c | |||
@@ -79,20 +79,19 @@ static unsigned int generic_powersave_bias_target(struct cpufreq_policy *policy, | |||
79 | return freq_next; | 79 | return freq_next; |
80 | } | 80 | } |
81 | 81 | ||
82 | cpufreq_frequency_table_target(policy, freq_table, freq_next, relation, | 82 | cpufreq_frequency_table_target(policy, freq_next, relation, &index); |
83 | &index); | ||
84 | freq_req = freq_table[index].frequency; | 83 | freq_req = freq_table[index].frequency; |
85 | freq_reduc = freq_req * od_tuners->powersave_bias / 1000; | 84 | freq_reduc = freq_req * od_tuners->powersave_bias / 1000; |
86 | freq_avg = freq_req - freq_reduc; | 85 | freq_avg = freq_req - freq_reduc; |
87 | 86 | ||
88 | /* Find freq bounds for freq_avg in freq_table */ | 87 | /* Find freq bounds for freq_avg in freq_table */ |
89 | index = 0; | 88 | index = 0; |
90 | cpufreq_frequency_table_target(policy, freq_table, freq_avg, | 89 | cpufreq_frequency_table_target(policy, freq_avg, CPUFREQ_RELATION_H, |
91 | CPUFREQ_RELATION_H, &index); | 90 | &index); |
92 | freq_lo = freq_table[index].frequency; | 91 | freq_lo = freq_table[index].frequency; |
93 | index = 0; | 92 | index = 0; |
94 | cpufreq_frequency_table_target(policy, freq_table, freq_avg, | 93 | cpufreq_frequency_table_target(policy, freq_avg, CPUFREQ_RELATION_L, |
95 | CPUFREQ_RELATION_L, &index); | 94 | &index); |
96 | freq_hi = freq_table[index].frequency; | 95 | freq_hi = freq_table[index].frequency; |
97 | 96 | ||
98 | /* Find out how long we have to be in hi and lo freqs */ | 97 | /* Find out how long we have to be in hi and lo freqs */ |
diff --git a/drivers/cpufreq/freq_table.c b/drivers/cpufreq/freq_table.c index f52b5473b1f4..f145b64649ef 100644 --- a/drivers/cpufreq/freq_table.c +++ b/drivers/cpufreq/freq_table.c | |||
@@ -114,7 +114,6 @@ int cpufreq_generic_frequency_table_verify(struct cpufreq_policy *policy) | |||
114 | EXPORT_SYMBOL_GPL(cpufreq_generic_frequency_table_verify); | 114 | EXPORT_SYMBOL_GPL(cpufreq_generic_frequency_table_verify); |
115 | 115 | ||
116 | int cpufreq_frequency_table_target(struct cpufreq_policy *policy, | 116 | int cpufreq_frequency_table_target(struct cpufreq_policy *policy, |
117 | struct cpufreq_frequency_table *table, | ||
118 | unsigned int target_freq, | 117 | unsigned int target_freq, |
119 | unsigned int relation, | 118 | unsigned int relation, |
120 | unsigned int *index) | 119 | unsigned int *index) |
@@ -128,6 +127,7 @@ int cpufreq_frequency_table_target(struct cpufreq_policy *policy, | |||
128 | .frequency = 0, | 127 | .frequency = 0, |
129 | }; | 128 | }; |
130 | struct cpufreq_frequency_table *pos; | 129 | struct cpufreq_frequency_table *pos; |
130 | struct cpufreq_frequency_table *table = policy->freq_table; | ||
131 | unsigned int freq, diff, i = 0; | 131 | unsigned int freq, diff, i = 0; |
132 | 132 | ||
133 | pr_debug("request for target %u kHz (relation: %u) for cpu %u\n", | 133 | pr_debug("request for target %u kHz (relation: %u) for cpu %u\n", |
diff --git a/drivers/cpufreq/powernv-cpufreq.c b/drivers/cpufreq/powernv-cpufreq.c index 54c45368e3f1..bf267c2dfe20 100644 --- a/drivers/cpufreq/powernv-cpufreq.c +++ b/drivers/cpufreq/powernv-cpufreq.c | |||
@@ -760,8 +760,7 @@ void powernv_cpufreq_work_fn(struct work_struct *work) | |||
760 | struct cpufreq_policy policy; | 760 | struct cpufreq_policy policy; |
761 | 761 | ||
762 | cpufreq_get_policy(&policy, cpu); | 762 | cpufreq_get_policy(&policy, cpu); |
763 | cpufreq_frequency_table_target(&policy, policy.freq_table, | 763 | cpufreq_frequency_table_target(&policy, policy.cur, |
764 | policy.cur, | ||
765 | CPUFREQ_RELATION_C, &index); | 764 | CPUFREQ_RELATION_C, &index); |
766 | powernv_cpufreq_target_index(&policy, index); | 765 | powernv_cpufreq_target_index(&policy, index); |
767 | cpumask_andnot(&mask, &mask, policy.cpus); | 766 | cpumask_andnot(&mask, &mask, policy.cpus); |
diff --git a/drivers/cpufreq/s3c24xx-cpufreq.c b/drivers/cpufreq/s3c24xx-cpufreq.c index 4567c3cab095..05a9737278f3 100644 --- a/drivers/cpufreq/s3c24xx-cpufreq.c +++ b/drivers/cpufreq/s3c24xx-cpufreq.c | |||
@@ -293,9 +293,8 @@ static int s3c_cpufreq_target(struct cpufreq_policy *policy, | |||
293 | __func__, policy, target_freq, relation); | 293 | __func__, policy, target_freq, relation); |
294 | 294 | ||
295 | if (ftab) { | 295 | if (ftab) { |
296 | if (cpufreq_frequency_table_target(policy, ftab, | 296 | if (cpufreq_frequency_table_target(policy, target_freq, |
297 | target_freq, relation, | 297 | relation, &index)) { |
298 | &index)) { | ||
299 | s3c_freq_dbg("%s: table failed\n", __func__); | 298 | s3c_freq_dbg("%s: table failed\n", __func__); |
300 | return -EINVAL; | 299 | return -EINVAL; |
301 | } | 300 | } |
@@ -323,14 +322,14 @@ static int s3c_cpufreq_target(struct cpufreq_policy *policy, | |||
323 | tmp_policy.min = policy->min * 1000; | 322 | tmp_policy.min = policy->min * 1000; |
324 | tmp_policy.max = policy->max * 1000; | 323 | tmp_policy.max = policy->max * 1000; |
325 | tmp_policy.cpu = policy->cpu; | 324 | tmp_policy.cpu = policy->cpu; |
325 | tmp_policy.freq_table = pll_reg; | ||
326 | 326 | ||
327 | /* cpufreq_frequency_table_target uses a pointer to 'index' | 327 | /* cpufreq_frequency_table_target uses a pointer to 'index' |
328 | * which is the number of the table entry, not the value of | 328 | * which is the number of the table entry, not the value of |
329 | * the table entry's index field. */ | 329 | * the table entry's index field. */ |
330 | 330 | ||
331 | ret = cpufreq_frequency_table_target(&tmp_policy, pll_reg, | 331 | ret = cpufreq_frequency_table_target(&tmp_policy, target_freq, |
332 | target_freq, relation, | 332 | relation, &index); |
333 | &index); | ||
334 | 333 | ||
335 | if (ret < 0) { | 334 | if (ret < 0) { |
336 | pr_err("%s: no PLL available\n", __func__); | 335 | pr_err("%s: no PLL available\n", __func__); |
diff --git a/drivers/cpufreq/s5pv210-cpufreq.c b/drivers/cpufreq/s5pv210-cpufreq.c index 06d85917b6d5..6b0cfc3b8c46 100644 --- a/drivers/cpufreq/s5pv210-cpufreq.c +++ b/drivers/cpufreq/s5pv210-cpufreq.c | |||
@@ -246,8 +246,7 @@ static int s5pv210_target(struct cpufreq_policy *policy, unsigned int index) | |||
246 | new_freq = s5pv210_freq_table[index].frequency; | 246 | new_freq = s5pv210_freq_table[index].frequency; |
247 | 247 | ||
248 | /* Finding current running level index */ | 248 | /* Finding current running level index */ |
249 | if (cpufreq_frequency_table_target(policy, s5pv210_freq_table, | 249 | if (cpufreq_frequency_table_target(policy, old_freq, CPUFREQ_RELATION_H, |
250 | old_freq, CPUFREQ_RELATION_H, | ||
251 | &priv_index)) { | 250 | &priv_index)) { |
252 | ret = -EINVAL; | 251 | ret = -EINVAL; |
253 | goto exit; | 252 | goto exit; |