Skip to content

Commit

Permalink
cpufreq: Drop cpufreq_disabled() check from cpufreq_cpu_{get|put}()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Viresh Kumar authored and Rafael J. Wysocki committed Feb 3, 2015
1 parent 6ffae8c commit 1e63eaf
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/cpufreq/cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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);
}
Expand Down

0 comments on commit 1e63eaf

Please sign in to comment.