cpufreq: Drop cpufreq_disabled() check from cpufreq_cpu_{get|put}()
authorViresh Kumar <viresh.kumar@linaro.org>
Tue, 27 Jan 2015 08:36:07 +0000 (14:06 +0530)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 3 Feb 2015 22:26:02 +0000 (23:26 +0100)
When cpufreq is disabled, the per-cpu variable would have been set to
NULL. Remove this unnecessary check.

[ Changelog from Saravana Kannan. ]

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Saravana Kannan <skannan@codeaurora.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/cpufreq.c

index 2b181f75da15f891559a69dfb5b3755957425fdd..158709418e21be24f93374b1b82fc4b4e695a812 100644 (file)
@@ -203,7 +203,7 @@ struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu)
        struct cpufreq_policy *policy = NULL;
        unsigned long flags;
 
-       if (cpufreq_disabled() || (cpu >= nr_cpu_ids))
+       if (cpu >= nr_cpu_ids)
                return NULL;
 
        if (!down_read_trylock(&cpufreq_rwsem))
@@ -230,9 +230,6 @@ EXPORT_SYMBOL_GPL(cpufreq_cpu_get);
 
 void cpufreq_cpu_put(struct cpufreq_policy *policy)
 {
-       if (cpufreq_disabled())
-               return;
-
        kobject_put(&policy->kobj);
        up_read(&cpufreq_rwsem);
 }