Thread (25 messages) 25 messages, 3 authors, 2025-09-03

Re: [PATCH v3 08/12] cpufreq: powerpc: macintosh: Use scope-based cleanup helper

From: Krzysztof Kozlowski <krzk@kernel.org>
Date: 2025-09-02 15:59:30
Also in: dri-devel, imx, intel-gfx, linux-acpi, linux-arm-kernel, linux-omap, linux-pm, lkml

On 01/09/2025 10:57, Zihuan Zhang wrote:
quoted hunk ↗ jump to hunk
+	struct cpufreq_policy *policy __free(put_cpufreq_policy) = cpufreq_cpu_get(0);
 	struct wf_control *clamp;
 	struct device *dev;
 	int ret;
 
-	policy = cpufreq_cpu_get(0);
 	if (!policy) {
 		pr_warn("%s: cpufreq policy not found cpu0\n", __func__);
 		return -EPROBE_DEFER;
@@ -79,8 +78,6 @@ static int __init wf_cpufreq_clamp_init(void)
 	ret = freq_qos_add_request(&policy->constraints, &qos_req, FREQ_QOS_MAX,
 				   max_freq);
 
-	cpufreq_cpu_put(policy);
-
Not much improvement. Previously this was simple code, easy to grasp.
Best regards,
Krzysztof

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help