Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Zihuan Zhang and committed by
Viresh Kumar
eaa9c1f3 d939047d

+1 -3
+1 -3
drivers/cpufreq/brcmstb-avs-cpufreq.c
··· 480 480 481 481 static unsigned int brcm_avs_cpufreq_get(unsigned int cpu) 482 482 { 483 - struct cpufreq_policy *policy = cpufreq_cpu_get(cpu); 483 + struct cpufreq_policy *policy __free(put_cpufreq_policy) = cpufreq_cpu_get(cpu); 484 484 struct private_data *priv; 485 485 486 486 if (!policy) 487 487 return 0; 488 488 489 489 priv = policy->driver_data; 490 - 491 - cpufreq_cpu_put(policy); 492 490 493 491 return brcm_avs_get_frequency(priv->base); 494 492 }