summaryrefslogtreecommitdiff
path: root/drivers/cpufreq
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2013-05-31 06:15:08 +0000
committerChanho Park <chanho61.park@samsung.com>2014-11-18 11:47:23 +0900
commit2247da9c0bb0427f1d81a71a8339edf5c1e434b2 (patch)
tree5d2695c01d77a7fe83437f1f5582e71700deeb97 /drivers/cpufreq
parent76cc076cb07233d984573623af2f0a62af35c869 (diff)
downloadlinux-3.10-2247da9c0bb0427f1d81a71a8339edf5c1e434b2.tar.gz
linux-3.10-2247da9c0bb0427f1d81a71a8339edf5c1e434b2.tar.bz2
linux-3.10-2247da9c0bb0427f1d81a71a8339edf5c1e434b2.zip
cpufreq: remove unnecessary cpufreq_cpu_{get|put}() calls
struct cpufreq_policy is already passed as argument to some routines like: __cpufreq_driver_getavg() and so we don't really need to do cpufreq_cpu_get() before and cpufreq_cpu_put() in them to get a policy structure. Remove them. Change-Id: I6a9ff8ed483a4f4faacc2ea047d93354dccdb0b6 Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r--drivers/cpufreq/cpufreq.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 24dd29adbd7..df519221ccd 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1555,10 +1555,6 @@ int cpufreq_driver_target(struct cpufreq_policy *policy,
{
int ret = -EINVAL;
- policy = cpufreq_cpu_get(policy->cpu);
- if (!policy)
- goto no_policy;
-
if (unlikely(lock_policy_rwsem_write(policy->cpu)))
goto fail;
@@ -1567,30 +1563,19 @@ int cpufreq_driver_target(struct cpufreq_policy *policy,
unlock_policy_rwsem_write(policy->cpu);
fail:
- cpufreq_cpu_put(policy);
-no_policy:
return ret;
}
EXPORT_SYMBOL_GPL(cpufreq_driver_target);
int __cpufreq_driver_getavg(struct cpufreq_policy *policy, unsigned int cpu)
{
- int ret = 0;
-
if (cpufreq_disabled())
- return ret;
+ return 0;
if (!cpufreq_driver->getavg)
return 0;
- policy = cpufreq_cpu_get(policy->cpu);
- if (!policy)
- return -EINVAL;
-
- ret = cpufreq_driver->getavg(policy, cpu);
-
- cpufreq_cpu_put(policy);
- return ret;
+ return cpufreq_driver->getavg(policy, cpu);
}
EXPORT_SYMBOL_GPL(__cpufreq_driver_getavg);