aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq
diff options
context:
space:
mode:
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 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
1586fail: 1582fail:
1587 cpufreq_cpu_put(policy);
1588no_policy:
1589 return ret; 1583 return ret;
1590} 1584}
1591EXPORT_SYMBOL_GPL(cpufreq_driver_target); 1585EXPORT_SYMBOL_GPL(cpufreq_driver_target);
1592 1586
1593int __cpufreq_driver_getavg(struct cpufreq_policy *policy, unsigned int cpu) 1587int __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}
1612EXPORT_SYMBOL_GPL(__cpufreq_driver_getavg); 1597EXPORT_SYMBOL_GPL(__cpufreq_driver_getavg);
1613 1598