summaryrefslogtreecommitdiff
path: root/drivers/cpufreq/cpufreq.c
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2015-01-02 12:34:33 +0530
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-01-23 22:49:34 +0100
commitd7a9771c1a37af8d0cd0cf97723aeea88b9de8bb (patch)
treee8131d4c3cc33fd7c24be19bfdfc86f278795bce /drivers/cpufreq/cpufreq.c
parent7f0c020ab6ecb513394de9b02df33a5cfc62084f (diff)
cpufreq: use light-weight cpufreq_cpu_get_raw() in __cpufreq_add_dev()
We just need to check if a 'policy' is already present for the cpu we are adding. We don't need to take all the locks and do kobject usage updates. Use the light-weight cpufreq_cpu_get_raw() routine instead. 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.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 127cc6f18ca5..3a415130f6e1 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1116,11 +1116,9 @@ static int __cpufreq_add_dev(struct device *dev, struct subsys_interface *sif)
/* check whether a different CPU already registered this
* CPU because it is in the same boat. */
- policy = cpufreq_cpu_get(cpu);
- if (unlikely(policy)) {
- cpufreq_cpu_put(policy);
+ policy = cpufreq_cpu_get_raw(cpu);
+ if (unlikely(policy))
return 0;
- }
if (!down_read_trylock(&cpufreq_rwsem))
return 0;