Skip to content

Commit b3beca7

Browse files
vireshkrafaeljw
authored andcommitted
cpufreq: Remove ->resolve_freq()
Commit e3c0623 ("cpufreq: add cpufreq_driver_resolve_freq()") introduced this callback, back in 2016, for drivers that provide the ->target() callback. The kernel hasn't seen a single user of it in the past 5 years and it is not likely to be used any time soon. Remove it for now. Signed-off-by: Viresh Kumar <[email protected]> [ rjw: Changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent f9ccdec commit b3beca7

File tree

4 files changed

+8
-27
lines changed

4 files changed

+8
-27
lines changed

Documentation/cpu-freq/cpu-drivers.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,6 @@ And optionally
5858

5959
.driver_data - cpufreq driver specific data.
6060

61-
.resolve_freq - Returns the most appropriate frequency for a target
62-
frequency. Doesn't change the frequency though.
63-
6461
.get_intermediate and target_intermediate - Used to switch to stable
6562
frequency while changing CPU frequency.
6663

Documentation/translations/zh_CN/cpu-freq/cpu-drivers.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ CPUfreq核心层注册一个cpufreq_driver结构体。
6464

6565
.driver_data - cpufreq驱动程序的特定数据。
6666

67-
.resolve_freq - 返回最适合目标频率的频率。不过并不能改变频率。
68-
6967
.get_intermediate 和 target_intermediate - 用于在改变CPU频率时切换到稳定
7068
的频率。
7169

drivers/cpufreq/cpufreq.c

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -527,22 +527,17 @@ EXPORT_SYMBOL_GPL(cpufreq_disable_fast_switch);
527527
static unsigned int __resolve_freq(struct cpufreq_policy *policy,
528528
unsigned int target_freq, unsigned int relation)
529529
{
530-
target_freq = clamp_val(target_freq, policy->min, policy->max);
531-
policy->cached_target_freq = target_freq;
530+
unsigned int idx;
532531

533-
if (cpufreq_driver->target_index) {
534-
unsigned int idx;
535-
536-
idx = cpufreq_frequency_table_target(policy, target_freq,
537-
relation);
538-
policy->cached_resolved_idx = idx;
539-
return policy->freq_table[idx].frequency;
540-
}
532+
target_freq = clamp_val(target_freq, policy->min, policy->max);
541533

542-
if (cpufreq_driver->resolve_freq)
543-
return cpufreq_driver->resolve_freq(policy, target_freq);
534+
if (!cpufreq_driver->target_index)
535+
return target_freq;
544536

545-
return target_freq;
537+
idx = cpufreq_frequency_table_target(policy, target_freq, relation);
538+
policy->cached_resolved_idx = idx;
539+
policy->cached_target_freq = target_freq;
540+
return policy->freq_table[idx].frequency;
546541
}
547542

548543
/**

include/linux/cpufreq.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -330,15 +330,6 @@ struct cpufreq_driver {
330330
unsigned long target_perf,
331331
unsigned long capacity);
332332

333-
/*
334-
* Caches and returns the lowest driver-supported frequency greater than
335-
* or equal to the target frequency, subject to any driver limitations.
336-
* Does not set the frequency. Only to be implemented for drivers with
337-
* target().
338-
*/
339-
unsigned int (*resolve_freq)(struct cpufreq_policy *policy,
340-
unsigned int target_freq);
341-
342333
/*
343334
* Only for drivers with target_index() and CPUFREQ_ASYNC_NOTIFICATION
344335
* unset.

0 commit comments

Comments
 (0)