提交 e8fdde10 编写于 作者: V Viresh Kumar 提交者: Rafael J. Wysocki

cpufreq: Remove extra variables from cpufreq_add_dev_symlink()

We call cpufreq_cpu_get() in cpufreq_add_dev_symlink() to increase usage
refcount of policy, but not to get a policy for the given CPU.  So, we
don't really need to capture the return value of this routine.  We can
simply use policy passed as an argument to cpufreq_add_dev_symlink().

Moreover debug print is rewritten to make it more clear.

[rjw: Changelog]
Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
上级 5302c3fb
...@@ -813,19 +813,18 @@ static int cpufreq_add_dev_symlink(unsigned int cpu, ...@@ -813,19 +813,18 @@ static int cpufreq_add_dev_symlink(unsigned int cpu,
int ret = 0; int ret = 0;
for_each_cpu(j, policy->cpus) { for_each_cpu(j, policy->cpus) {
struct cpufreq_policy *managed_policy;
struct device *cpu_dev; struct device *cpu_dev;
if (j == cpu) if (j == cpu)
continue; continue;
pr_debug("CPU %u already managed, adding link\n", j); pr_debug("Adding link for CPU: %u\n", j);
managed_policy = cpufreq_cpu_get(cpu); cpufreq_cpu_get(cpu);
cpu_dev = get_cpu_device(j); cpu_dev = get_cpu_device(j);
ret = sysfs_create_link(&cpu_dev->kobj, &policy->kobj, ret = sysfs_create_link(&cpu_dev->kobj, &policy->kobj,
"cpufreq"); "cpufreq");
if (ret) { if (ret) {
cpufreq_cpu_put(managed_policy); cpufreq_cpu_put(policy);
return ret; return ret;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册