diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2013-05-31 02:15:08 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-06-04 08:26:27 -0400 |
commit | a262e94cdcb961762e5d91e7fcb857bba7d420a0 (patch) | |
tree | c72b98652841617dae7a103ca2478227efa6d90e /drivers/cpufreq | |
parent | 27209d913e5127a1e7ef6655319a406833462d0c (diff) |
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.
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.c | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index ce9273a7b4e3..f8c28607ccd6 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
@@ -1572,10 +1572,6 @@ int cpufreq_driver_target(struct cpufreq_policy *policy, | |||
1572 | { | 1572 | { |
1573 | int ret = -EINVAL; | 1573 | int ret = -EINVAL; |
1574 | 1574 | ||
1575 | policy = cpufreq_cpu_get(policy->cpu); | ||
1576 | if (!policy) | ||
1577 | goto no_policy; | ||
1578 | |||
1579 | if (unlikely(lock_policy_rwsem_write(policy->cpu))) | 1575 | if (unlikely(lock_policy_rwsem_write(policy->cpu))) |
1580 | goto fail; | 1576 | goto fail; |
1581 | 1577 | ||
@@ -1584,30 +1580,19 @@ int cpufreq_driver_target(struct cpufreq_policy *policy, | |||
1584 | unlock_policy_rwsem_write(policy->cpu); | 1580 | unlock_policy_rwsem_write(policy->cpu); |
1585 | 1581 | ||
1586 | fail: | 1582 | fail: |
1587 | cpufreq_cpu_put(policy); | ||
1588 | no_policy: | ||
1589 | return ret; | 1583 | return ret; |
1590 | } | 1584 | } |
1591 | EXPORT_SYMBOL_GPL(cpufreq_driver_target); | 1585 | EXPORT_SYMBOL_GPL(cpufreq_driver_target); |
1592 | 1586 | ||
1593 | int __cpufreq_driver_getavg(struct cpufreq_policy *policy, unsigned int cpu) | 1587 | int __cpufreq_driver_getavg(struct cpufreq_policy *policy, unsigned int cpu) |
1594 | { | 1588 | { |
1595 | int ret = 0; | ||
1596 | |||
1597 | if (cpufreq_disabled()) | 1589 | if (cpufreq_disabled()) |
1598 | return ret; | 1590 | return 0; |
1599 | 1591 | ||
1600 | if (!cpufreq_driver->getavg) | 1592 | if (!cpufreq_driver->getavg) |
1601 | return 0; | 1593 | return 0; |
1602 | 1594 | ||
1603 | policy = cpufreq_cpu_get(policy->cpu); | 1595 | return cpufreq_driver->getavg(policy, cpu); |
1604 | if (!policy) | ||
1605 | return -EINVAL; | ||
1606 | |||
1607 | ret = cpufreq_driver->getavg(policy, cpu); | ||
1608 | |||
1609 | cpufreq_cpu_put(policy); | ||
1610 | return ret; | ||
1611 | } | 1596 | } |
1612 | EXPORT_SYMBOL_GPL(__cpufreq_driver_getavg); | 1597 | EXPORT_SYMBOL_GPL(__cpufreq_driver_getavg); |
1613 | 1598 | ||