提交 d7a9771c 编写于 作者: V Viresh Kumar 提交者: Rafael J. Wysocki

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: NViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
上级 7f0c020a
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册