cpufreq: Make cpufreq_driver->exit() return void
Subsystems (14)
Viresh Kumar
maintainercover cpufreq: Make cpufreq_driver->exit() return void
Make exit() return void, since it isn't used by the core.
Based on initial patches sent by Lizhe [1].
Rafael, I will take this through my tree for 6.11.
--
Viresh
[1] https://lore.kernel.org/all/[email protected]/
Lizhe (1):
cpufreq: Make cpufreq_driver->exit() return void
Viresh Kumar (3):
cpufreq: nforce2: Remove empty exit() callback
cpufreq: loongson2: Remove empty exit() callback
cpufreq: pcc: Remove empty exit() callback
drivers/cpufreq/acpi-cpufreq.c | 4 +--- drivers/cpufreq/amd-pstate.c | 7 ++----- drivers/cpufreq/apple-soc-cpufreq.c | 4 +--- drivers/cpufreq/bmips-cpufreq.c | 4 +--- drivers/cpufreq/cppc_cpufreq.c | 3 +-- drivers/cpufreq/cpufreq-dt.c | 3 +-- drivers/cpufreq/cpufreq-nforce2.c | 6 ------ drivers/cpufreq/e_powersaver.c | 3 +-- drivers/cpufreq/intel_pstate.c | 8 +++----- drivers/cpufreq/loongson2_cpufreq.c | 6 ------ drivers/cpufreq/mediatek-cpufreq-hw.c | 4 +--- drivers/cpufreq/mediatek-cpufreq.c | 4 +--- drivers/cpufreq/omap-cpufreq.c | 3 +-- drivers/cpufreq/pasemi-cpufreq.c | 6 ++---- drivers/cpufreq/pcc-cpufreq.c | 6 ------ drivers/cpufreq/powernow-k6.c | 5 ++--- drivers/cpufreq/powernow-k7.c | 3 +-- drivers/cpufreq/powernow-k8.c | 6 ++---- drivers/cpufreq/powernv-cpufreq.c | 4 +--- drivers/cpufreq/ppc_cbe_cpufreq.c | 3 +-- drivers/cpufreq/qcom-cpufreq-hw.c | 4 +--- drivers/cpufreq/qoriq-cpufreq.c | 4 +--- drivers/cpufreq/scmi-cpufreq.c | 4 +--- drivers/cpufreq/scpi-cpufreq.c | 4 +--- drivers/cpufreq/sh-cpufreq.c | 4 +--- drivers/cpufreq/sparc-us2e-cpufreq.c | 3 +-- drivers/cpufreq/sparc-us3-cpufreq.c | 3 +-- drivers/cpufreq/speedstep-centrino.c | 10 +++------- drivers/cpufreq/tegra194-cpufreq.c | 4 +--- drivers/cpufreq/vexpress-spc-cpufreq.c | 5 ++--- include/linux/cpufreq.h | 2 +- 31 files changed, 37 insertions(+), 102 deletions(-)
Signature · 1 line
2.31.1.272.g89b43f80a514
Viresh Kumar
maintainerPATCH 1/4 cpufreq: nforce2: Remove empty exit() callback
The exit() callback is optional, remove the empty one.
--- drivers/cpufreq/cpufreq-nforce2.c | 6 ------ 1 file changed, 6 deletions(-)
drivers/cpufreq/cpufreq-nforce2.c +0 -6
@@ -359,11 +359,6 @@ static int nforce2_cpu_init(struct cpufreq_policy *policy)return 0 ; } -static int nforce2_cpu_exit (struct cpufreq_policy *policy) -{ -return 0 ; -} -static struct cpufreq_driver nforce2_driver = { .name ="nforce2" , .flags =CPUFREQ_NO_AUTO_DYNAMIC_SWITCHING ,
@@ -371,7 +366,6 @@ static struct cpufreq_driver nforce2_driver = { .target = nforce2_target, .get = nforce2_get, .init = nforce2_cpu_init, - .exit = nforce2_cpu_exit, };#ifdef MODULE
Signature · 1 line
2.31.1.272.g89b43f80a514
Viresh Kumar
maintainerPATCH 2/4 cpufreq: loongson2: Remove empty exit() callback
In reply to Viresh KumarThe exit() callback is optional, remove the empty one.
--- drivers/cpufreq/loongson2_cpufreq.c | 6 ------ 1 file changed, 6 deletions(-)
drivers/cpufreq/loongson2_cpufreq.c +0 -6
@@ -85,18 +85,12 @@ static int loongson2_cpufreq_cpu_init(struct cpufreq_policy *policy)return 0 ; } -static int loongson2_cpufreq_exit (struct cpufreq_policy *policy) -{ -return 0 ; -} -static struct cpufreq_driver loongson2_cpufreq_driver = { .name ="loongson2" , .init = loongson2_cpufreq_cpu_init, .verify = cpufreq_generic_frequency_table_verify, .target_index = loongson2_cpufreq_target, .get = cpufreq_generic_get, - .exit = loongson2_cpufreq_exit, .attr = cpufreq_generic_attr, };
Signature · 1 line
2.31.1.272.g89b43f80a514
Re: [PATCH 2/4] cpufreq: loongson2: Remove empty exit() callback
Quoted 35 lines · Viresh Kumar
The
exit()callback is optional, remove the empty one.Signed-off-by Viresh Kumar <[email protected]>--- drivers/cpufreq/loongson2_cpufreq.c | 6 ------ 1 file changed, 6 deletions(-)drivers/cpufreq/loongson2_cpufreq.c +0
-7@@ -85,18 +85,12 @@ static int loongson2_cpufreq_cpu_init(struct cpufreq_policy *policy)return 0 ; } -static int loongson2_cpufreq_exit (struct cpufreq_policy *policy) -{ -return 0 ; -} -static struct cpufreq_driver loongson2_cpufreq_driver = { .name ="loongson2" , .init = loongson2_cpufreq_cpu_init, .verify = cpufreq_generic_frequency_table_verify, .target_index = loongson2_cpufreq_target, .get = cpufreq_generic_get, - .exit = loongson2_cpufreq_exit, .attr = cpufreq_generic_attr, }; --2.31.1.272.g89b43f80a514
Viresh Kumar
maintainerPATCH 3/4 cpufreq: pcc: Remove empty exit() callback
In reply to Viresh KumarThe exit() callback is optional, remove the empty one.
--- drivers/cpufreq/pcc-cpufreq.c | 6 ------ 1 file changed, 6 deletions(-)
drivers/cpufreq/pcc-cpufreq.c +0 -6
@@ -562,18 +562,12 @@ static int pcc_cpufreq_cpu_init(struct cpufreq_policy *policy)return result; } -static int pcc_cpufreq_cpu_exit (struct cpufreq_policy *policy) -{ -return 0 ; -} -static struct cpufreq_driver pcc_cpufreq_driver = { .flags =CPUFREQ_CONST_LOOPS , .get = pcc_get_freq, .verify = pcc_cpufreq_verify, .target = pcc_cpufreq_target, .init = pcc_cpufreq_cpu_init, - .exit = pcc_cpufreq_cpu_exit, .name ="pcc-cpufreq" , };
Signature · 1 line
2.31.1.272.g89b43f80a514
Viresh Kumar
maintainerPATCH 4/4 cpufreq: Make cpufreq_driver->exit() return void
In reply to Viresh KumarFrom: Lizhe <[email protected]>
The cpufreq core doesn't check the return type of the exit() callback and there is not much the core can do on failures at that point. Just drop the returned value and make it return void.
--- drivers/cpufreq/acpi-cpufreq.c | 4 +--- drivers/cpufreq/amd-pstate.c | 7 ++----- drivers/cpufreq/apple-soc-cpufreq.c | 4 +--- drivers/cpufreq/bmips-cpufreq.c | 4 +--- drivers/cpufreq/cppc_cpufreq.c | 3 +-- drivers/cpufreq/cpufreq-dt.c | 3 +-- drivers/cpufreq/e_powersaver.c | 3 +-- drivers/cpufreq/intel_pstate.c | 8 +++----- drivers/cpufreq/mediatek-cpufreq-hw.c | 4 +--- drivers/cpufreq/mediatek-cpufreq.c | 4 +--- drivers/cpufreq/omap-cpufreq.c | 3 +-- drivers/cpufreq/pasemi-cpufreq.c | 6 ++---- drivers/cpufreq/powernow-k6.c | 5 ++--- drivers/cpufreq/powernow-k7.c | 3 +-- drivers/cpufreq/powernow-k8.c | 6 ++---- drivers/cpufreq/powernv-cpufreq.c | 4 +--- drivers/cpufreq/ppc_cbe_cpufreq.c | 3 +-- drivers/cpufreq/qcom-cpufreq-hw.c | 4 +--- drivers/cpufreq/qoriq-cpufreq.c | 4 +--- drivers/cpufreq/scmi-cpufreq.c | 4 +--- drivers/cpufreq/scpi-cpufreq.c | 4 +--- drivers/cpufreq/sh-cpufreq.c | 4 +--- drivers/cpufreq/sparc-us2e-cpufreq.c | 3 +-- drivers/cpufreq/sparc-us3-cpufreq.c | 3 +-- drivers/cpufreq/speedstep-centrino.c | 10 +++------- drivers/cpufreq/tegra194-cpufreq.c | 4 +--- drivers/cpufreq/vexpress-spc-cpufreq.c | 5 ++--- include/linux/cpufreq.h | 2 +- 28 files changed, 37 insertions(+), 84 deletions(-)
drivers/cpufreq/acpi-cpufreq.c +1 -3
@@ -906,7 +906,7 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)return result; } -static int acpi_cpufreq_cpu_exit (struct cpufreq_policy *policy) +static void acpi_cpufreq_cpu_exit (struct cpufreq_policy *policy) {struct acpi_cpufreq_data *data = policy->driver_data;
@@ -919,8 +919,6 @@ static int acpi_cpufreq_cpu_exit(struct cpufreq_policy *policy)free_cpumask_var (data->freqdomain_cpus);kfree (policy->freq_table);kfree (data); - -return 0 ; }static int acpi_cpufreq_resume (struct cpufreq_policy *policy)
drivers/cpufreq/amd-pstate.c +2 -5
@@ -1090,7 +1090,7 @@ static int amd_pstate_cpu_init(struct cpufreq_policy *policy)return ret; } -static int amd_pstate_cpu_exit (struct cpufreq_policy *policy) +static void amd_pstate_cpu_exit (struct cpufreq_policy *policy) {struct amd_cpudata *cpudata = policy->driver_data;
@@ -1098,8 +1098,6 @@ static int amd_pstate_cpu_exit(struct cpufreq_policy *policy)freq_qos_remove_request (&cpudata->req[0 ]); policy->fast_switch_possible = false;kfree (cpudata); - -return 0 ; }static int amd_pstate_cpu_resume (struct cpufreq_policy *policy)
@@ -1542,7 +1540,7 @@ static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy)return ret; } -static int amd_pstate_epp_cpu_exit (struct cpufreq_policy *policy) +static void amd_pstate_epp_cpu_exit (struct cpufreq_policy *policy) {struct amd_cpudata *cpudata = policy->driver_data;
@@ -1552,7 +1550,6 @@ static int amd_pstate_epp_cpu_exit(struct cpufreq_policy *policy) }pr_debug ("CPU %d exiting\n" , policy->cpu); -return 0 ; }static void amd_pstate_epp_update_limit (struct cpufreq_policy *policy)
drivers/cpufreq/apple-soc-cpufreq.c +1 -3
@@ -305,7 +305,7 @@ static int apple_soc_cpufreq_init(struct cpufreq_policy *policy)return ret; } -static int apple_soc_cpufreq_exit (struct cpufreq_policy *policy) +static void apple_soc_cpufreq_exit (struct cpufreq_policy *policy) {struct apple_cpu_priv *priv = policy->driver_data;
@@ -313,8 +313,6 @@ static int apple_soc_cpufreq_exit(struct cpufreq_policy *policy)dev_pm_opp_remove_all_dynamic (priv->cpu_dev);iounmap (priv->reg_base);kfree (priv); - -return 0 ; }static struct cpufreq_driver apple_soc_cpufreq_driver = {
drivers/cpufreq/bmips-cpufreq.c +1 -3
@@ -121,11 +121,9 @@ static int bmips_cpufreq_target_index(struct cpufreq_policy *policy,return 0 ; } -static int bmips_cpufreq_exit (struct cpufreq_policy *policy) +static void bmips_cpufreq_exit (struct cpufreq_policy *policy) {kfree (policy->freq_table); - -return 0 ; }static int bmips_cpufreq_init (struct cpufreq_policy *policy)
drivers/cpufreq/cppc_cpufreq.c +1 -2
@@ -688,7 +688,7 @@ static int cppc_cpufreq_cpu_init(struct cpufreq_policy *policy)return ret; } -static int cppc_cpufreq_cpu_exit (struct cpufreq_policy *policy) +static void cppc_cpufreq_cpu_exit (struct cpufreq_policy *policy) {struct cppc_cpudata *cpu_data = policy->driver_data;struct cppc_perf_caps *caps = &cpu_data->perf_caps;
@@ -705,7 +705,6 @@ static int cppc_cpufreq_cpu_exit(struct cpufreq_policy *policy) caps->lowest_perf, cpu, ret);cppc_cpufreq_put_cpu_data (policy); -return 0 ; }static inline u64 get_delta (u64 t1,u64 t0)
drivers/cpufreq/cpufreq-dt.c +1 -2
@@ -157,10 +157,9 @@ static int cpufreq_offline(struct cpufreq_policy *policy)return 0 ; } -static int cpufreq_exit (struct cpufreq_policy *policy) +static void cpufreq_exit (struct cpufreq_policy *policy) {clk_put (policy->clk); -return 0 ; }static struct cpufreq_driver dt_cpufreq_driver = {
drivers/cpufreq/e_powersaver.c +1 -2
@@ -360,14 +360,13 @@ static int eps_cpu_init(struct cpufreq_policy *policy)return 0 ; } -static int eps_cpu_exit (struct cpufreq_policy *policy) +static void eps_cpu_exit (struct cpufreq_policy *policy) {unsigned int cpu = policy->cpu;/* Bye */ kfree (eps_cpu[cpu]); eps_cpu[cpu] =NULL ; -return 0 ; }static struct cpufreq_driver eps_driver = {
drivers/cpufreq/intel_pstate.c +3 -5
@@ -2715,13 +2715,11 @@ static int intel_pstate_cpu_offline(struct cpufreq_policy *policy)return intel_cpufreq_cpu_offline (policy); } -static int intel_pstate_cpu_exit (struct cpufreq_policy *policy) +static void intel_pstate_cpu_exit (struct cpufreq_policy *policy) {pr_debug ("CPU %d exiting\n" , policy->cpu); policy->fast_switch_possible = false; - -return 0 ; }static int __intel_pstate_cpu_init (struct cpufreq_policy *policy)
@@ -3052,7 +3050,7 @@ static int intel_cpufreq_cpu_init(struct cpufreq_policy *policy)return ret; } -static int intel_cpufreq_cpu_exit (struct cpufreq_policy *policy) +static void intel_cpufreq_cpu_exit (struct cpufreq_policy *policy) {struct freq_qos_request *req;
@@ -3062,7 +3060,7 @@ static int intel_cpufreq_cpu_exit(struct cpufreq_policy *policy)freq_qos_remove_request (req);kfree (req); -return intel_pstate_cpu_exit (policy); +intel_pstate_cpu_exit (policy); }static int intel_cpufreq_suspend (struct cpufreq_policy *policy)
drivers/cpufreq/mediatek-cpufreq-hw.c +1 -3
@@ -260,7 +260,7 @@ static int mtk_cpufreq_hw_cpu_init(struct cpufreq_policy *policy)return 0 ; } -static int mtk_cpufreq_hw_cpu_exit (struct cpufreq_policy *policy) +static void mtk_cpufreq_hw_cpu_exit (struct cpufreq_policy *policy) {struct mtk_cpufreq_data *data = policy->driver_data;struct resource *res = data->res;
@@ -270,8 +270,6 @@ static int mtk_cpufreq_hw_cpu_exit(struct cpufreq_policy *policy)writel_relaxed (0x0 , data->reg_bases[REG_FREQ_ENABLE ]);iounmap (base);release_mem_region (res->start,resource_size (res)); - -return 0 ; }static void mtk_cpufreq_register_em (struct cpufreq_policy *policy)
drivers/cpufreq/mediatek-cpufreq.c +1 -3
@@ -599,13 +599,11 @@ static int mtk_cpufreq_init(struct cpufreq_policy *policy)return 0 ; } -static int mtk_cpufreq_exit (struct cpufreq_policy *policy) +static void mtk_cpufreq_exit (struct cpufreq_policy *policy) {struct mtk_cpu_dvfs_info *info = policy->driver_data;dev_pm_opp_free_cpufreq_table (info->cpu_dev, &policy->freq_table); - -return 0 ; }static struct cpufreq_driver mtk_cpufreq_driver = {
drivers/cpufreq/omap-cpufreq.c +1 -2
@@ -135,11 +135,10 @@ static int omap_cpu_init(struct cpufreq_policy *policy)return 0 ; } -static int omap_cpu_exit (struct cpufreq_policy *policy) +static void omap_cpu_exit (struct cpufreq_policy *policy) {freq_table_free ();clk_put (policy->clk); -return 0 ; }static struct cpufreq_driver omap_driver = {
drivers/cpufreq/pasemi-cpufreq.c +2 -4
@@ -204,21 +204,19 @@ static int pas_cpufreq_cpu_init(struct cpufreq_policy *policy)return err; } -static int pas_cpufreq_cpu_exit (struct cpufreq_policy *policy) +static void pas_cpufreq_cpu_exit (struct cpufreq_policy *policy) {/* * We don't support CPU hotplug. Don't unmap after the system * has already made it to a running state. */ if (system_state >=SYSTEM_RUNNING ) -return 0 ; +return ;if (sdcasr_mapbase)iounmap (sdcasr_mapbase);if (sdcpwr_mapbase)iounmap (sdcpwr_mapbase); - -return 0 ; } static int pas_cpufreq_target(struct cpufreq_policy *policy,
drivers/cpufreq/powernow-k6.c +2 -3
@@ -219,7 +219,7 @@ static int powernow_k6_cpu_init(struct cpufreq_policy *policy) } -static int powernow_k6_cpu_exit (struct cpufreq_policy *policy) +static void powernow_k6_cpu_exit (struct cpufreq_policy *policy) {unsigned int i;
@@ -234,10 +234,9 @@ static int powernow_k6_cpu_exit(struct cpufreq_policy *policy)cpufreq_freq_transition_begin (policy, &freqs);powernow_k6_target (policy, i);cpufreq_freq_transition_end (policy, &freqs,0 ); -break ; +return ; } } -return 0 ; }static unsigned int powernow_k6_get (unsigned int cpu)
drivers/cpufreq/powernow-k7.c +1 -2
@@ -644,7 +644,7 @@ static int powernow_cpu_init(struct cpufreq_policy *policy)return 0 ; } -static int powernow_cpu_exit (struct cpufreq_policy *policy) +static void powernow_cpu_exit (struct cpufreq_policy *policy) {#ifdef CONFIG_X86_POWERNOW_K7_ACPI if (acpi_processor_perf) {
@@ -655,7 +655,6 @@ static int powernow_cpu_exit(struct cpufreq_policy *policy)#endif kfree (powernow_table); -return 0 ; }static struct cpufreq_driver powernow_driver = {
drivers/cpufreq/powernow-k8.c +2 -4
@@ -1089,13 +1089,13 @@ static int powernowk8_cpu_init(struct cpufreq_policy *pol)return -ENODEV ; } -static int powernowk8_cpu_exit (struct cpufreq_policy *pol) +static void powernowk8_cpu_exit (struct cpufreq_policy *pol) {struct powernow_k8_data *data =per_cpu (powernow_data, pol->cpu);int cpu;if (!data) -return -EINVAL ; +return ;powernow_k8_cpu_exit_acpi (data);
@@ -1104,8 +1104,6 @@ static int powernowk8_cpu_exit(struct cpufreq_policy *pol)/* pol->cpus will be empty here, use related_cpus instead. */ for_each_cpu (cpu, pol->related_cpus)per_cpu (powernow_data, cpu) =NULL ; - -return 0 ; }static void query_values_on_cpu (void *_err)
drivers/cpufreq/powernv-cpufreq.c +1 -3
@@ -874,7 +874,7 @@ static int powernv_cpufreq_cpu_init(struct cpufreq_policy *policy)return 0 ; } -static int powernv_cpufreq_cpu_exit (struct cpufreq_policy *policy) +static void powernv_cpufreq_cpu_exit (struct cpufreq_policy *policy) {struct powernv_smp_call_data freq_data;struct global_pstate_info *gpstates = policy->driver_data;
@@ -886,8 +886,6 @@ static int powernv_cpufreq_cpu_exit(struct cpufreq_policy *policy)del_timer_sync (&gpstates->timer);kfree (policy->driver_data); - -return 0 ; } static int powernv_cpufreq_reboot_notifier(struct notifier_block *nb,
drivers/cpufreq/ppc_cbe_cpufreq.c +1 -2
@@ -113,10 +113,9 @@ static int cbe_cpufreq_cpu_init(struct cpufreq_policy *policy)return 0 ; } -static int cbe_cpufreq_cpu_exit (struct cpufreq_policy *policy) +static void cbe_cpufreq_cpu_exit (struct cpufreq_policy *policy) {cbe_cpufreq_pmi_policy_exit (policy); -return 0 ; } static int cbe_cpufreq_target(struct cpufreq_policy *policy,
drivers/cpufreq/qcom-cpufreq-hw.c +1 -3
@@ -573,7 +573,7 @@ static int qcom_cpufreq_hw_cpu_init(struct cpufreq_policy *policy)return qcom_cpufreq_hw_lmh_init (policy, index); } -static int qcom_cpufreq_hw_cpu_exit (struct cpufreq_policy *policy) +static void qcom_cpufreq_hw_cpu_exit (struct cpufreq_policy *policy) {struct device *cpu_dev =get_cpu_device (policy->cpu);struct qcom_cpufreq_data *data = policy->driver_data;
@@ -583,8 +583,6 @@ static int qcom_cpufreq_hw_cpu_exit(struct cpufreq_policy *policy)qcom_cpufreq_hw_lmh_exit (data);kfree (policy->freq_table);kfree (data); - -return 0 ; }static void qcom_cpufreq_ready (struct cpufreq_policy *policy)
drivers/cpufreq/qoriq-cpufreq.c +1 -3
@@ -225,7 +225,7 @@ static int qoriq_cpufreq_cpu_init(struct cpufreq_policy *policy)return -ENODEV ; } -static int qoriq_cpufreq_cpu_exit (struct cpufreq_policy *policy) +static void qoriq_cpufreq_cpu_exit (struct cpufreq_policy *policy) {struct cpu_data *data = policy->driver_data;
@@ -233,8 +233,6 @@ static int qoriq_cpufreq_cpu_exit(struct cpufreq_policy *policy)kfree (data->table);kfree (data); policy->driver_data =NULL ; - -return 0 ; } static int qoriq_cpufreq_target(struct cpufreq_policy *policy,
drivers/cpufreq/scmi-cpufreq.c +1 -3
@@ -308,7 +308,7 @@ static int scmi_cpufreq_init(struct cpufreq_policy *policy)return ret; } -static int scmi_cpufreq_exit (struct cpufreq_policy *policy) +static void scmi_cpufreq_exit (struct cpufreq_policy *policy) {struct scmi_data *priv = policy->driver_data;
@@ -316,8 +316,6 @@ static int scmi_cpufreq_exit(struct cpufreq_policy *policy)dev_pm_opp_remove_all_dynamic (priv->cpu_dev);free_cpumask_var (priv->opp_shared_cpus);kfree (priv); - -return 0 ; }static void scmi_cpufreq_register_em (struct cpufreq_policy *policy)
drivers/cpufreq/scpi-cpufreq.c +1 -3
@@ -167,7 +167,7 @@ static int scpi_cpufreq_init(struct cpufreq_policy *policy)return ret; } -static int scpi_cpufreq_exit (struct cpufreq_policy *policy) +static void scpi_cpufreq_exit (struct cpufreq_policy *policy) {struct scpi_data *priv = policy->driver_data;
@@ -175,8 +175,6 @@ static int scpi_cpufreq_exit(struct cpufreq_policy *policy)dev_pm_opp_free_cpufreq_table (priv->cpu_dev, &policy->freq_table);dev_pm_opp_remove_all_dynamic (priv->cpu_dev);kfree (priv); - -return 0 ; }static struct cpufreq_driver scpi_cpufreq_driver = {
drivers/cpufreq/sh-cpufreq.c +1 -3
@@ -135,14 +135,12 @@ static int sh_cpufreq_cpu_init(struct cpufreq_policy *policy)return 0 ; } -static int sh_cpufreq_cpu_exit (struct cpufreq_policy *policy) +static void sh_cpufreq_cpu_exit (struct cpufreq_policy *policy) {unsigned int cpu = policy->cpu;struct clk *cpuclk = &per_cpu (sh_cpuclk, cpu);clk_put (cpuclk); - -return 0 ; }static struct cpufreq_driver sh_cpufreq_driver = {
drivers/cpufreq/sparc-us2e-cpufreq.c +1 -2
@@ -296,10 +296,9 @@ static int us2e_freq_cpu_init(struct cpufreq_policy *policy)return 0 ; } -static int us2e_freq_cpu_exit (struct cpufreq_policy *policy) +static void us2e_freq_cpu_exit (struct cpufreq_policy *policy) {us2e_freq_target (policy,0 ); -return 0 ; }static struct cpufreq_driver cpufreq_us2e_driver = {
drivers/cpufreq/sparc-us3-cpufreq.c +1 -2
@@ -140,10 +140,9 @@ static int us3_freq_cpu_init(struct cpufreq_policy *policy)return 0 ; } -static int us3_freq_cpu_exit (struct cpufreq_policy *policy) +static void us3_freq_cpu_exit (struct cpufreq_policy *policy) {us3_freq_target (policy,0 ); -return 0 ; }static struct cpufreq_driver cpufreq_us3_driver = {
drivers/cpufreq/speedstep-centrino.c +3 -7
@@ -400,16 +400,12 @@ static int centrino_cpu_init(struct cpufreq_policy *policy)return 0 ; } -static int centrino_cpu_exit (struct cpufreq_policy *policy) +static void centrino_cpu_exit (struct cpufreq_policy *policy) {unsigned int cpu = policy->cpu; -if (!per_cpu (centrino_model, cpu)) -return -ENODEV ; - -per_cpu (centrino_model, cpu) =NULL ; - -return 0 ; +if (per_cpu (centrino_model, cpu)) +per_cpu (centrino_model, cpu) =NULL ; }/**
drivers/cpufreq/tegra194-cpufreq.c +1 -3
@@ -551,14 +551,12 @@ static int tegra194_cpufreq_offline(struct cpufreq_policy *policy)return 0 ; } -static int tegra194_cpufreq_exit (struct cpufreq_policy *policy) +static void tegra194_cpufreq_exit (struct cpufreq_policy *policy) {struct device *cpu_dev =get_cpu_device (policy->cpu);dev_pm_opp_remove_all_dynamic (cpu_dev);dev_pm_opp_of_cpumask_remove_table (policy->related_cpus); - -return 0 ; } static int tegra194_cpufreq_set_target(struct cpufreq_policy *policy,
drivers/cpufreq/vexpress-spc-cpufreq.c +2 -3
@@ -447,7 +447,7 @@ static int ve_spc_cpufreq_init(struct cpufreq_policy *policy)return 0 ; } -static int ve_spc_cpufreq_exit (struct cpufreq_policy *policy) +static void ve_spc_cpufreq_exit (struct cpufreq_policy *policy) {struct device *cpu_dev;
@@ -455,11 +455,10 @@ static int ve_spc_cpufreq_exit(struct cpufreq_policy *policy)if (!cpu_dev) {pr_err ("%s: failed to get cpu%d device\n" , __func__, policy->cpu); -return -ENODEV ; +return ; }put_cluster_clk_and_freq_table (cpu_dev, policy->related_cpus); -return 0 ; }static struct cpufreq_driver ve_spc_cpufreq_driver = {
include/linux/cpufreq.h +1 -1
@@ -396,7 +396,7 @@ struct cpufreq_driver {int (*online)(struct cpufreq_policy *policy);int (*offline)(struct cpufreq_policy *policy); -int (*exit)(struct cpufreq_policy *policy); +void (*exit)(struct cpufreq_policy *policy);int (*suspend)(struct cpufreq_policy *policy);int (*resume)(struct cpufreq_policy *policy);
Signature · 1 line
2.31.1.272.g89b43f80a514
Il 04/07/24 08:53, Viresh Kumar ha scritto:
Quoted 9 lines
From: Lizhe <[email protected]>
The cpufreq core doesn't check the return type of the
exit()callback and there is not much the core can do on failures at that point. Just drop the returned value and make it return void.Signed-off-by Lizhe <[email protected]>[ Viresh: Reworked the patches to fix all missing changes together. ]Signed-off-by Viresh Kumar <[email protected]>
For MediaTek:
Quoted 10 lines · Viresh Kumar
From: Lizhe <[email protected]>
The cpufreq core doesn't check the return type of the
exit()callback and there is not much the core can do on failures at that point. Just drop the returned value and make it return void.Signed-off-by Lizhe <[email protected]>[ Viresh: Reworked the patches to fix all missing changes together. ]Signed-off-by Viresh Kumar <[email protected]>---
[...]
Quoted 3 lines
drivers/cpufreq/scmi-cpufreq.c | 4 +--- drivers/cpufreq/scpi-cpufreq.c | 4 +--- drivers/cpufreq/vexpress-spc-cpufreq.c | 5 ++---
(For the above 3 files)
--
Regards,
Sudeep
Quoted 31 lines · Viresh Kumar
From: Lizhe <[email protected]>
The cpufreq core doesn't check the return type of the
exit()callback and there is not much the core can do on failures at that point. Just drop the returned value and make it return void.Signed-off-by Lizhe <[email protected]>[ Viresh: Reworked the patches to fix all missing changes together. ]Signed-off-by Viresh Kumar <[email protected]>--- drivers/cpufreq/acpi-cpufreq.c | 4 +--- drivers/cpufreq/amd-pstate.c | 7 ++----- drivers/cpufreq/apple-soc-cpufreq.c | 4 +--- drivers/cpufreq/bmips-cpufreq.c | 4 +--- drivers/cpufreq/cppc_cpufreq.c | 3 +-- drivers/cpufreq/cpufreq-dt.c | 3 +-- drivers/cpufreq/e_powersaver.c | 3 +-- drivers/cpufreq/intel_pstate.c | 8 +++----- drivers/cpufreq/mediatek-cpufreq-hw.c | 4 +--- drivers/cpufreq/mediatek-cpufreq.c | 4 +--- drivers/cpufreq/omap-cpufreq.c | 3 +-- drivers/cpufreq/pasemi-cpufreq.c | 6 ++---- drivers/cpufreq/powernow-k6.c | 5 ++--- drivers/cpufreq/powernow-k7.c | 3 +-- drivers/cpufreq/powernow-k8.c | 6 ++---- drivers/cpufreq/powernv-cpufreq.c | 4 +--- drivers/cpufreq/ppc_cbe_cpufreq.c | 3 +-- drivers/cpufreq/qcom-cpufreq-hw.c | 4 +--- drivers/cpufreq/qoriq-cpufreq.c | 4 +--- drivers/cpufreq/scmi-cpufreq.c | 4 +--- drivers/cpufreq/scpi-cpufreq.c | 4 +---
Quoted 8 lines
drivers/cpufreq/sh-cpufreq.c | 4 +--- drivers/cpufreq/sparc-us2e-cpufreq.c | 3 +-- drivers/cpufreq/sparc-us3-cpufreq.c | 3 +-- drivers/cpufreq/speedstep-centrino.c | 10 +++------- drivers/cpufreq/tegra194-cpufreq.c | 4 +--- drivers/cpufreq/vexpress-spc-cpufreq.c | 5 ++--- include/linux/cpufreq.h | 2 +- 28 files changed, 37 insertions(+), 84 deletions(-)
Quoted 11 lines · Viresh Kumar
From: Lizhe <[email protected]>
The cpufreq core doesn't check the return type of the
exit()callback and there is not much the core can do on failures at that point. Just drop the returned value and make it return void.Signed-off-by Lizhe <[email protected]>[ Viresh: Reworked the patches to fix all missing changes together. ]Signed-off-by Viresh Kumar <[email protected]>--- drivers/cpufreq/bmips-cpufreq.c | 4 +---
For the above:
Signature · 1 line
Florian
Quoted 10 lines · Viresh Kumar
From: Lizhe <[email protected]>
The cpufreq core doesn't check the return type of the
exit()callback and there is not much the core can do on failures at that point. Just drop the returned value and make it return void.Signed-off-by Lizhe <[email protected]>[ Viresh: Reworked the patches to fix all missing changes together. ]Signed-off-by Viresh Kumar <[email protected]>---
[...]
Quoted 1 line
drivers/cpufreq/omap-cpufreq.c | 3 +--
For OMAP:
Quoted 6 lines · Viresh Kumar
Make
exit()return void, since it isn't used by the core.Based on initial patches sent by Lizhe [1].
Rafael, I will take this through my tree for 6.11.
Sure.
for the series.
Thanks!
Quoted 50 lines
--
Viresh[1] https://lore.kernel.org/all/[email protected]/
Lizhe (1):
cpufreq: Makecpufreq_driver->exit()return voidViresh Kumar (3):
cpufreq: nforce2: Remove emptyexit()callback
cpufreq: loongson2: Remove emptyexit()callback
cpufreq: pcc: Remove emptyexit()callbackdrivers/cpufreq/acpi-cpufreq.c | 4 +--- drivers/cpufreq/amd-pstate.c | 7 ++----- drivers/cpufreq/apple-soc-cpufreq.c | 4 +--- drivers/cpufreq/bmips-cpufreq.c | 4 +--- drivers/cpufreq/cppc_cpufreq.c | 3 +-- drivers/cpufreq/cpufreq-dt.c | 3 +-- drivers/cpufreq/cpufreq-nforce2.c | 6 ------ drivers/cpufreq/e_powersaver.c | 3 +-- drivers/cpufreq/intel_pstate.c | 8 +++----- drivers/cpufreq/loongson2_cpufreq.c | 6 ------ drivers/cpufreq/mediatek-cpufreq-hw.c | 4 +--- drivers/cpufreq/mediatek-cpufreq.c | 4 +--- drivers/cpufreq/omap-cpufreq.c | 3 +-- drivers/cpufreq/pasemi-cpufreq.c | 6 ++---- drivers/cpufreq/pcc-cpufreq.c | 6 ------ drivers/cpufreq/powernow-k6.c | 5 ++--- drivers/cpufreq/powernow-k7.c | 3 +-- drivers/cpufreq/powernow-k8.c | 6 ++---- drivers/cpufreq/powernv-cpufreq.c | 4 +--- drivers/cpufreq/ppc_cbe_cpufreq.c | 3 +-- drivers/cpufreq/qcom-cpufreq-hw.c | 4 +--- drivers/cpufreq/qoriq-cpufreq.c | 4 +--- drivers/cpufreq/scmi-cpufreq.c | 4 +--- drivers/cpufreq/scpi-cpufreq.c | 4 +--- drivers/cpufreq/sh-cpufreq.c | 4 +--- drivers/cpufreq/sparc-us2e-cpufreq.c | 3 +-- drivers/cpufreq/sparc-us3-cpufreq.c | 3 +-- drivers/cpufreq/speedstep-centrino.c | 10 +++------- drivers/cpufreq/tegra194-cpufreq.c | 4 +--- drivers/cpufreq/vexpress-spc-cpufreq.c | 5 ++--- include/linux/cpufreq.h | 2 +- 31 files changed, 37 insertions(+), 102 deletions(-)--
2.31.1.272.g89b43f80a514