Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 73bf0fc2 authored by Viresh Kumar's avatar Viresh Kumar Committed by Rafael J. Wysocki
Browse files

cpufreq: Don't remove sysfs link for policy->cpu



"cpufreq" directory in policy->cpu is never created using
sysfs_create_link(), but using kobject_init_and_add(). And so we
shouldn't call sysfs_remove_link() for policy->cpu().  sysfs stuff
for policy->cpu is automatically removed when we call kobject_put()
for dying policy.

Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Tested-by: default avatarDirk Brandewie <dirk.brandewie@gmail.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 62b36cc1
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -1059,7 +1059,9 @@ static int __cpufreq_remove_dev(struct device *dev, struct subsys_interface *sif
	cpus = cpumask_weight(data->cpus);
	cpus = cpumask_weight(data->cpus);
	cpumask_clear_cpu(cpu, data->cpus);
	cpumask_clear_cpu(cpu, data->cpus);


	if (unlikely((cpu == data->cpu) && (cpus > 1))) {
	if (cpu != data->cpu) {
		sysfs_remove_link(&dev->kobj, "cpufreq");
	} else if (cpus > 1) {
		/* first sibling now owns the new sysfs dir */
		/* first sibling now owns the new sysfs dir */
		cpu_dev = get_cpu_device(cpumask_first(data->cpus));
		cpu_dev = get_cpu_device(cpumask_first(data->cpus));
		sysfs_remove_link(&cpu_dev->kobj, "cpufreq");
		sysfs_remove_link(&cpu_dev->kobj, "cpufreq");
@@ -1084,7 +1086,6 @@ static int __cpufreq_remove_dev(struct device *dev, struct subsys_interface *sif
	pr_debug("%s: removing link, cpu: %d\n", __func__, cpu);
	pr_debug("%s: removing link, cpu: %d\n", __func__, cpu);
	cpufreq_cpu_put(data);
	cpufreq_cpu_put(data);
	unlock_policy_rwsem_write(cpu);
	unlock_policy_rwsem_write(cpu);
	sysfs_remove_link(&dev->kobj, "cpufreq");


	/* If cpu is last user of policy, free policy */
	/* If cpu is last user of policy, free policy */
	if (cpus == 1) {
	if (cpus == 1) {