summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZihuan Zhang <zhangzihuan@kylinos.cn>2025-08-27 10:31:54 +0800
committerViresh Kumar <viresh.kumar@linaro.org>2025-08-29 11:42:24 +0530
commit95102e0cc15688ddffc8da1f15cfec2276fa45e5 (patch)
tree9bac1e969ce68f6c07b67b6557af943d9a2f2233
parentc8dc2368b23e1a9f11be4c941e13f3985195d0c9 (diff)
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>
-rw-r--r--drivers/cpufreq/s5pv210-cpufreq.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/cpufreq/s5pv210-cpufreq.c b/drivers/cpufreq/s5pv210-cpufreq.c
index 76c888ed8d16..4215621deb3f 100644
--- a/drivers/cpufreq/s5pv210-cpufreq.c
+++ b/drivers/cpufreq/s5pv210-cpufreq.c
@@ -554,17 +554,15 @@ out_dmc0:
static int s5pv210_cpufreq_reboot_notifier_event(struct notifier_block *this,
unsigned long event, void *ptr)
{
+ struct cpufreq_policy *policy __free(put_cpufreq_policy) = cpufreq_cpu_get(0);
int ret;
- struct cpufreq_policy *policy;
- policy = cpufreq_cpu_get(0);
if (!policy) {
pr_debug("cpufreq: get no policy for cpu0\n");
return NOTIFY_BAD;
}
ret = cpufreq_driver_target(policy, SLEEP_FREQ, 0);
- cpufreq_cpu_put(policy);
if (ret < 0)
return NOTIFY_BAD;