diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2013-02-05 16:21:14 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-02-05 16:21:14 -0500 |
commit | 73bf0fc2b03d1f4fdada0ec430dc20bfb089cfd5 (patch) | |
tree | d2140fed485ae5c577ebcb321ef9e379cbccc3f3 /drivers/cpufreq/cpufreq.c | |
parent | 62b36cc1c83aca1cd252772e82cbc5d9ef8ff25b (diff) |
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: Viresh Kumar <viresh.kumar@linaro.org>
Tested-by: Dirk Brandewie <dirk.brandewie@gmail.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq/cpufreq.c')
-rw-r--r-- | drivers/cpufreq/cpufreq.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 0b4be4481433..b63b3cbfe2c4 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
@@ -1059,7 +1059,9 @@ static int __cpufreq_remove_dev(struct device *dev, struct subsys_interface *sif | |||
1059 | cpus = cpumask_weight(data->cpus); | 1059 | cpus = cpumask_weight(data->cpus); |
1060 | cpumask_clear_cpu(cpu, data->cpus); | 1060 | cpumask_clear_cpu(cpu, data->cpus); |
1061 | 1061 | ||
1062 | if (unlikely((cpu == data->cpu) && (cpus > 1))) { | 1062 | if (cpu != data->cpu) { |
1063 | sysfs_remove_link(&dev->kobj, "cpufreq"); | ||
1064 | } else if (cpus > 1) { | ||
1063 | /* first sibling now owns the new sysfs dir */ | 1065 | /* first sibling now owns the new sysfs dir */ |
1064 | cpu_dev = get_cpu_device(cpumask_first(data->cpus)); | 1066 | cpu_dev = get_cpu_device(cpumask_first(data->cpus)); |
1065 | sysfs_remove_link(&cpu_dev->kobj, "cpufreq"); | 1067 | sysfs_remove_link(&cpu_dev->kobj, "cpufreq"); |
@@ -1084,7 +1086,6 @@ static int __cpufreq_remove_dev(struct device *dev, struct subsys_interface *sif | |||
1084 | pr_debug("%s: removing link, cpu: %d\n", __func__, cpu); | 1086 | pr_debug("%s: removing link, cpu: %d\n", __func__, cpu); |
1085 | cpufreq_cpu_put(data); | 1087 | cpufreq_cpu_put(data); |
1086 | unlock_policy_rwsem_write(cpu); | 1088 | unlock_policy_rwsem_write(cpu); |
1087 | sysfs_remove_link(&dev->kobj, "cpufreq"); | ||
1088 | 1089 | ||
1089 | /* If cpu is last user of policy, free policy */ | 1090 | /* If cpu is last user of policy, free policy */ |
1090 | if (cpus == 1) { | 1091 | if (cpus == 1) { |