diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2013-07-31 08:31:33 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-08-07 17:02:49 -0400 |
commit | e8fdde1011ea45792e60f14f620b01f78cb0d34d (patch) | |
tree | 15288e7bada0645c59b8e1a72bd33fd908bfca7f | |
parent | 5302c3fb2e62f4ca5e43e060491ba299f58c5231 (diff) |
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: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r-- | drivers/cpufreq/cpufreq.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 370abb66babc..b6154ca1f896 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
@@ -813,19 +813,18 @@ static int cpufreq_add_dev_symlink(unsigned int cpu, | |||
813 | int ret = 0; | 813 | int ret = 0; |
814 | 814 | ||
815 | for_each_cpu(j, policy->cpus) { | 815 | for_each_cpu(j, policy->cpus) { |
816 | struct cpufreq_policy *managed_policy; | ||
817 | struct device *cpu_dev; | 816 | struct device *cpu_dev; |
818 | 817 | ||
819 | if (j == cpu) | 818 | if (j == cpu) |
820 | continue; | 819 | continue; |
821 | 820 | ||
822 | pr_debug("CPU %u already managed, adding link\n", j); | 821 | pr_debug("Adding link for CPU: %u\n", j); |
823 | managed_policy = cpufreq_cpu_get(cpu); | 822 | cpufreq_cpu_get(cpu); |
824 | cpu_dev = get_cpu_device(j); | 823 | cpu_dev = get_cpu_device(j); |
825 | ret = sysfs_create_link(&cpu_dev->kobj, &policy->kobj, | 824 | ret = sysfs_create_link(&cpu_dev->kobj, &policy->kobj, |
826 | "cpufreq"); | 825 | "cpufreq"); |
827 | if (ret) { | 826 | if (ret) { |
828 | cpufreq_cpu_put(managed_policy); | 827 | cpufreq_cpu_put(policy); |
829 | return ret; | 828 | return ret; |
830 | } | 829 | } |
831 | } | 830 | } |