Commit 95102e0c authored by Zihuan Zhang's avatar Zihuan Zhang Committed by Viresh Kumar
Browse files

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: default avatarZihuan Zhang <zhangzihuan@kylinos.cn>
[ Viresh: Minor changes ]
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
parent c8dc2368
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -554,17 +554,15 @@ static int s5pv210_cpu_init(struct cpufreq_policy *policy)
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;