cpufreq: Drop redundant check from cpufreq_update_current_freq()
[deliverable/linux.git] / drivers / cpufreq / cpufreq.c
index 07c933c6c29a163410b568d2558fd88bde73c4ff..118b4f30a4060e25f8490bae66f1e02952ecffb3 100644 (file)
@@ -1544,9 +1544,6 @@ static unsigned int cpufreq_update_current_freq(struct cpufreq_policy *policy)
 {
        unsigned int new_freq;
 
-       if (cpufreq_suspended)
-               return 0;
-
        new_freq = cpufreq_driver->get(policy->cpu);
        if (!new_freq)
                return 0;
@@ -1820,7 +1817,7 @@ EXPORT_SYMBOL(cpufreq_unregister_notifier);
 unsigned int cpufreq_driver_fast_switch(struct cpufreq_policy *policy,
                                        unsigned int target_freq)
 {
-       clamp_val(target_freq, policy->min, policy->max);
+       target_freq = clamp_val(target_freq, policy->min, policy->max);
 
        return cpufreq_driver->fast_switch(policy, target_freq);
 }
@@ -2280,6 +2277,10 @@ int cpufreq_update_policy(unsigned int cpu)
         * -> ask driver for current freq and notify governors about a change
         */
        if (cpufreq_driver->get && !cpufreq_driver->setpolicy) {
+               if (cpufreq_suspended) {
+                       ret = -EAGAIN;
+                       goto unlock;
+               }
                new_policy.cur = cpufreq_update_current_freq(policy);
                if (WARN_ON(!new_policy.cur)) {
                        ret = -EIO;
This page took 0.025072 seconds and 5 git commands to generate.