cpufreq: Remove ready() callback
Viresh Kumar
maintainercover cpufreq: Remove ready() callback
Remove the last few users of the ready() callback and get rid of it.
Viresh Kumar (3):
cpufreq: acpi: Remove acpi_cpufreq_cpu_ready()
cpufreq: sh: Remove sh_cpufreq_cpu_ready()
cpufreq: Remove ready() callback
Documentation/cpu-freq/cpu-drivers.rst | 3 --- .../translations/zh_CN/cpu-freq/cpu-drivers.rst | 2 -- drivers/cpufreq/acpi-cpufreq.c | 14 +++----------- drivers/cpufreq/cpufreq.c | 4 ---- drivers/cpufreq/sh-cpufreq.c | 11 ----------- include/linux/cpufreq.h | 3 --- 6 files changed, 3 insertions(+), 34 deletions(-)
Signature · 1 line
2.31.1.272.g89b43f80a514
Viresh Kumar
maintainerPATCH 1/3 cpufreq: acpi: Remove acpi_cpufreq_cpu_ready()
The ready() callback was implemented earlier for acpi-cpufreq driver as we wanted to use policy->cpuinfo.max_freq for which the policy was required to be verified.
That is no longer the case and we can do the pr_warn() right from ->init() callback now. Remove acpi_cpufreq_cpu_ready().
--- drivers/cpufreq/acpi-cpufreq.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-)
drivers/cpufreq/acpi-cpufreq.c +3 -11
@@ -889,6 +889,9 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy) policy->fast_switch_possible = !acpi_pstate_strict && !(policy_is_shared (policy) && policy->shared_type !=CPUFREQ_SHARED_TYPE_ANY ); +if (perf->states[0 ].core_frequency *1000 != freq_table[0 ].frequency) +pr_warn (FW_WARN "P-state 0 is not max freq\n" ); +return result; err_unreg:
@@ -918,16 +921,6 @@ static int acpi_cpufreq_cpu_exit(struct cpufreq_policy *policy)return 0 ; } -static void acpi_cpufreq_cpu_ready (struct cpufreq_policy *policy) -{ -struct acpi_processor_performance *perf =per_cpu_ptr (acpi_perf_data, - policy->cpu); -unsigned int freq = policy->freq_table[0 ].frequency; - -if (perf->states[0 ].core_frequency *1000 != freq) -pr_warn (FW_WARN "P-state 0 is not max freq\n" ); -} -static int acpi_cpufreq_resume (struct cpufreq_policy *policy) {struct acpi_cpufreq_data *data = policy->driver_data;
@@ -955,7 +948,6 @@ static struct cpufreq_driver acpi_cpufreq_driver = { .bios_limit = acpi_processor_get_bios_limit, .init = acpi_cpufreq_cpu_init, .exit = acpi_cpufreq_cpu_exit, - .ready = acpi_cpufreq_cpu_ready, .resume = acpi_cpufreq_resume, .name = "acpi-cpufreq", .attr = acpi_cpufreq_attr,
Signature · 1 line
2.31.1.272.g89b43f80a514
Viresh Kumar
maintainerPATCH 2/3 cpufreq: sh: Remove sh_cpufreq_cpu_ready()
In reply to Viresh KumarThe ->ready() callback is going away and since we don't do any important stuff in sh_cpufreq_cpu_ready(), remove it.
--- drivers/cpufreq/sh-cpufreq.c | 11 ----------- 1 file changed, 11 deletions(-)
drivers/cpufreq/sh-cpufreq.c +0 -11
@@ -145,16 +145,6 @@ static int sh_cpufreq_cpu_exit(struct cpufreq_policy *policy)return 0 ; } -static void sh_cpufreq_cpu_ready (struct cpufreq_policy *policy) -{ -struct device *dev =get_cpu_device (policy->cpu); - -dev_info (dev,"CPU Frequencies - Minimum %u.%03u MHz, " -"Maximum %u.%03u MHz.\n" , - policy->min /1000 , policy->min %1000 , - policy->max /1000 , policy->max %1000 ); -} -static struct cpufreq_driver sh_cpufreq_driver = { .name ="sh" , .flags =CPUFREQ_NO_AUTO_DYNAMIC_SWITCHING ,
@@ -163,7 +153,6 @@ static struct cpufreq_driver sh_cpufreq_driver = { .verify = sh_cpufreq_verify, .init = sh_cpufreq_cpu_init, .exit = sh_cpufreq_cpu_exit, - .ready = sh_cpufreq_cpu_ready, .attr = cpufreq_generic_attr, };
Signature · 1 line
2.31.1.272.g89b43f80a514
Viresh Kumar
maintainerPATCH 3/3 cpufreq: Remove ready() callback
In reply to Viresh KumarThis isn't used anymore, get rid of it.
--- Documentation/cpu-freq/cpu-drivers.rst | 3 --- Documentation/translations/zh_CN/cpu-freq/cpu-drivers.rst | 2 -- drivers/cpufreq/cpufreq.c | 4 ---- include/linux/cpufreq.h | 3 --- 4 files changed, 12 deletions(-)
Documentation/cpu-freq/cpu-drivers.rst +0 -3
@@ -75,9 +75,6 @@ And optionally .resume - A pointer to a per-policy resume function which is called with interrupts disabled and _before_ the governor is started again. - .ready - A pointer to a per-policy ready function which is called after - the policy is fully initialized. - .attr - A pointer to a NULL-terminated list of "struct freq_attr" which allow to export values to sysfs.
Documentation/translations/zh_CN/cpu-freq/cpu-drivers.rst +0 -2
@@ -80,8 +80,6 @@ 并且可选择 .resume - 一个指向per-policy恢复函数的指针,该函数在关中断且在调节器再一次开始前被 调用。 - .ready - 一个指向per-policy准备函数的指针,该函数在策略完全初始化之后被调用。 - .attr - 一个指向NULL结尾的"struct freq_attr"列表的指针,该函数允许导出值到 sysfs。
drivers/cpufreq/cpufreq.c +0 -4
@@ -1517,10 +1517,6 @@ static int cpufreq_online(unsigned int cpu)kobject_uevent (&policy->kobj,KOBJ_ADD ); -/* Callback for handling stuff after policy is ready */ -if (cpufreq_driver->ready) - cpufreq_driver->ready (policy); -if (cpufreq_thermal_control_enabled (cpufreq_driver)) policy->cdev =of_cpufreq_cooling_register (policy);
include/linux/cpufreq.h +0 -3
@@ -367,9 +367,6 @@ struct cpufreq_driver {int (*suspend)(struct cpufreq_policy *policy);int (*resume)(struct cpufreq_policy *policy); -/* Will be called after the driver is fully initialized */ -void (*ready)(struct cpufreq_policy *policy); -struct freq_attr **attr;/* platform specific boost support code */
Signature · 1 line
2.31.1.272.g89b43f80a514
Rafael J. Wysocki
maintainerQuoted 7 lines · Viresh Kumar
Remove the last few users of the
ready()callback and get rid of it.Viresh Kumar (3):
cpufreq: acpi: Removeacpi_cpufreq_cpu_ready()
cpufreq: sh: Removesh_cpufreq_cpu_ready()
cpufreq: Removeready()callback
All patches in the series applied, thanks!