diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2012-10-30 20:28:15 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2012-11-14 18:33:09 -0500 |
commit | 5a1c022850ea5d64c2997bf9b89f5ae112d5ee4d (patch) | |
tree | a6ee4f063d362d456fe3e8c8475bf441aa51dfd8 /drivers/cpufreq/cpufreq.c | |
parent | da58445570326ac2a342770a9c9a2646276e1721 (diff) |
cpufreq: Avoid calling cpufreq driver's target() routine if target_freq == policy->cur
Avoid calling cpufreq driver's target() routine if new frequency is same as
policies current frequency.
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/cpufreq.c')
-rw-r--r-- | drivers/cpufreq/cpufreq.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 261ef654a352..28dc134cec36 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
@@ -1476,6 +1476,10 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy, | |||
1476 | 1476 | ||
1477 | pr_debug("target for CPU %u: %u kHz, relation %u\n", policy->cpu, | 1477 | pr_debug("target for CPU %u: %u kHz, relation %u\n", policy->cpu, |
1478 | target_freq, relation); | 1478 | target_freq, relation); |
1479 | |||
1480 | if (target_freq == policy->cur) | ||
1481 | return 0; | ||
1482 | |||
1479 | if (cpu_online(policy->cpu) && cpufreq_driver->target) | 1483 | if (cpu_online(policy->cpu) && cpufreq_driver->target) |
1480 | retval = cpufreq_driver->target(policy, target_freq, relation); | 1484 | retval = cpufreq_driver->target(policy, target_freq, relation); |
1481 | 1485 | ||