Skip to content

Commit 5c84c1b

Browse files
vireshkrafaeljw
authored andcommitted
cpufreq: Clear real_cpus mask from remove_cpu_dev_symlink()
add_cpu_dev_symlink() is responsible for setting the CPUs in the real_cpus mask, the reverse of which should be done from remove_cpu_dev_symlink() to make it look clean and avoid any breakage later on. Move the call to clear the mask to remove_cpu_dev_symlink(). Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent bbd67f1 commit 5c84c1b

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

drivers/cpufreq/cpufreq.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,11 +1020,12 @@ static void add_cpu_dev_symlink(struct cpufreq_policy *policy, unsigned int cpu,
10201020
dev_err(dev, "cpufreq symlink creation failed\n");
10211021
}
10221022

1023-
static void remove_cpu_dev_symlink(struct cpufreq_policy *policy,
1023+
static void remove_cpu_dev_symlink(struct cpufreq_policy *policy, int cpu,
10241024
struct device *dev)
10251025
{
10261026
dev_dbg(dev, "%s: Removing symlink\n", __func__);
10271027
sysfs_remove_link(&dev->kobj, "cpufreq");
1028+
cpumask_clear_cpu(cpu, policy->real_cpus);
10281029
}
10291030

10301031
static int cpufreq_add_dev_interface(struct cpufreq_policy *policy)
@@ -1532,7 +1533,7 @@ static int cpufreq_online(unsigned int cpu)
15321533

15331534
out_destroy_policy:
15341535
for_each_cpu(j, policy->real_cpus)
1535-
remove_cpu_dev_symlink(policy, get_cpu_device(j));
1536+
remove_cpu_dev_symlink(policy, j, get_cpu_device(j));
15361537

15371538
up_write(&policy->rwsem);
15381539

@@ -1657,8 +1658,7 @@ static void cpufreq_remove_dev(struct device *dev, struct subsys_interface *sif)
16571658
if (cpu_online(cpu))
16581659
cpufreq_offline(cpu);
16591660

1660-
cpumask_clear_cpu(cpu, policy->real_cpus);
1661-
remove_cpu_dev_symlink(policy, dev);
1661+
remove_cpu_dev_symlink(policy, cpu, dev);
16621662

16631663
if (cpumask_empty(policy->real_cpus)) {
16641664
/* We did light-weight exit earlier, do full tear down now */

0 commit comments

Comments
 (0)