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

Krzysztof Kozlowski krzk at kernel.org
Wed Sep 3 01:59:18 AEST 2025


On 01/09/2025 10:57, Zihuan Zhang wrote:
> +	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



More information about the Linuxppc-dev mailing list