Skip to content

Commit

Permalink
cpufreq: powernow-k8: Use related_cpus instead of cpus in driver.exit()
Browse files Browse the repository at this point in the history
[ Upstream commit 03997da ]

Since the 'cpus' field of policy structure will become empty in the
cpufreq core API, it is better to use 'related_cpus' in the exit()
callback of driver.

Fixes: c327476 ("cpufreq: powernow-k8: Initialize per-cpu data-structures properly")
Signed-off-by: Liao Chang <liaochang1@huawei.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Liao Chang authored and gregkh committed Sep 13, 2023
1 parent 91f7627 commit 6f2b842
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/cpufreq/powernow-k8.c
Expand Up @@ -1101,7 +1101,8 @@ static int powernowk8_cpu_exit(struct cpufreq_policy *pol)

kfree(data->powernow_table);
kfree(data);
for_each_cpu(cpu, pol->cpus)
/* pol->cpus will be empty here, use related_cpus instead. */
for_each_cpu(cpu, pol->related_cpus)
per_cpu(powernow_data, cpu) = NULL;

return 0;
Expand Down

0 comments on commit 6f2b842

Please sign in to comment.