diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2016-06-27 07:29:34 +0300 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2016-07-07 01:14:27 +0300 |
commit | 825773609c8ae34a19d4b593555493ae2754eff7 (patch) | |
tree | ecf8c5ed90f21878a66d795aa6be0222c08fe247 /drivers/cpufreq/acpi-cpufreq.c | |
parent | da0c6dc00c69d0adaae99c3b3d2ea0c869a3fb35 (diff) | |
download | linux-825773609c8ae34a19d4b593555493ae2754eff7.tar.xz |
cpufreq: Reuse new freq-table helpers
This patch migrates few users of cpufreq tables to the new helpers
that work on sorted freq-tables.
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/acpi-cpufreq.c')
-rw-r--r-- | drivers/cpufreq/acpi-cpufreq.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c index 32a15052f363..11c9a078e0fd 100644 --- a/drivers/cpufreq/acpi-cpufreq.c +++ b/drivers/cpufreq/acpi-cpufreq.c @@ -468,20 +468,14 @@ unsigned int acpi_cpufreq_fast_switch(struct cpufreq_policy *policy, struct acpi_cpufreq_data *data = policy->driver_data; struct acpi_processor_performance *perf; struct cpufreq_frequency_table *entry; - unsigned int next_perf_state, next_freq, freq; + unsigned int next_perf_state, next_freq, index; /* * Find the closest frequency above target_freq. - * - * The table is sorted in the reverse order with respect to the - * frequency and all of the entries are valid (see the initialization). */ - entry = policy->freq_table; - do { - entry++; - freq = entry->frequency; - } while (freq >= target_freq && freq != CPUFREQ_TABLE_END); - entry--; + index = cpufreq_table_find_index_dl(policy, target_freq); + + entry = &policy->freq_table[index]; next_freq = entry->frequency; next_perf_state = entry->driver_data; |