Skip to content

Commit 95102e0

Browse files
Zihuan Zhangvireshk
authored andcommitted
cpufreq: s5pv210: 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 ] Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
1 parent c8dc236 commit 95102e0

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

drivers/cpufreq/s5pv210-cpufreq.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -554,17 +554,15 @@ static int s5pv210_cpu_init(struct cpufreq_policy *policy)
554554
static int s5pv210_cpufreq_reboot_notifier_event(struct notifier_block *this,
555555
unsigned long event, void *ptr)
556556
{
557+
struct cpufreq_policy *policy __free(put_cpufreq_policy) = cpufreq_cpu_get(0);
557558
int ret;
558-
struct cpufreq_policy *policy;
559559

560-
policy = cpufreq_cpu_get(0);
561560
if (!policy) {
562561
pr_debug("cpufreq: get no policy for cpu0\n");
563562
return NOTIFY_BAD;
564563
}
565564

566565
ret = cpufreq_driver_target(policy, SLEEP_FREQ, 0);
567-
cpufreq_cpu_put(policy);
568566

569567
if (ret < 0)
570568
return NOTIFY_BAD;

0 commit comments

Comments
 (0)