Skip to content

Commit eaa9c1f

Browse files
Zihuan Zhangvireshk
authored andcommitted
cpufreq: brcmstb-avs: Use scope-based cleanup helper
Replace the manual cpufreq_cpu_put() with __free(put_cpufreq_policy) annotation for policy references. This reduces the risk of reference counting mistakes and aligns the code with the latest kernel style. No functional change intended. Signed-off-by: Zihuan Zhang <zhangzihuan@kylinos.cn> [ Viresh: Minor changes to commit log ] Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
1 parent d939047 commit eaa9c1f

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

drivers/cpufreq/brcmstb-avs-cpufreq.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -480,16 +480,14 @@ static bool brcm_avs_is_firmware_loaded(struct private_data *priv)
480480

481481
static unsigned int brcm_avs_cpufreq_get(unsigned int cpu)
482482
{
483-
struct cpufreq_policy *policy = cpufreq_cpu_get(cpu);
483+
struct cpufreq_policy *policy __free(put_cpufreq_policy) = cpufreq_cpu_get(cpu);
484484
struct private_data *priv;
485485

486486
if (!policy)
487487
return 0;
488488

489489
priv = policy->driver_data;
490490

491-
cpufreq_cpu_put(policy);
492-
493491
return brcm_avs_get_frequency(priv->base);
494492
}
495493

0 commit comments

Comments
 (0)