]> git.baikalelectronics.ru Git - kernel.git/commit
cpufreq: check cpufreq_policy_list instead of scanning policies for all CPUs
authorViresh Kumar <viresh.kumar@linaro.org>
Fri, 2 Jan 2015 07:04:35 +0000 (12:34 +0530)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 23 Jan 2015 21:49:35 +0000 (22:49 +0100)
commit2a5e2626f1f2109865fd69a5280227a57e5762e7
treeb1bfcf042ecf6a15ef4d0218c88ec79a8c4526d8
parent8979eb0993919dea147c7970818c42a1160ee7dc
cpufreq: check cpufreq_policy_list instead of scanning policies for all CPUs

CPUFREQ_STICKY flag is set by drivers which don't want to get unregistered
even if cpufreq-core isn't able to initialize policy for any CPU.

When this flag isn't set, we try to unregister the driver. To find out
which CPUs are registered and which are not, we try to check per_cpu
cpufreq_cpu_data for all CPUs. Because we have a list of valid policies
available now, we better check if the list is empty or not instead of
the 'for' loop. That will be much more efficient.

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