cpufreq: Register governors at core_initcall
authorQuentin Perret <qperret@google.com>
Mon, 29 Jun 2020 08:24:59 +0000 (13:54 +0530)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 2 Jul 2020 11:03:30 +0000 (13:03 +0200)
commit10dd8573b09e84b81539d939d55ebdb6a36c5f3a
treeda0835325c0c812473ac33dddda211c869802407
parent8cc46ae565c393f77417cb9530b1265eb50f5d2e
cpufreq: Register governors at core_initcall

Currently, most CPUFreq governors are registered at the core_initcall
time when the given governor is the default one, and the module_init
time otherwise.

In preparation for letting users specify the default governor on the
kernel command line, change all of them to be registered at the
core_initcall unconditionally, as it is already the case for the
schedutil and performance governors. This will allow us to assume
that builtin governors have been registered before the built-in
CPUFreq drivers probe.

And since all governors have similar init/exit patterns now, introduce
two new macros, cpufreq_governor_{init,exit}(), to factorize the code.

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Quentin Perret <qperret@google.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
[ rjw: Changelog ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
arch/powerpc/platforms/cell/cpufreq_spudemand.c
drivers/cpufreq/cpufreq_conservative.c
drivers/cpufreq/cpufreq_ondemand.c
drivers/cpufreq/cpufreq_performance.c
drivers/cpufreq/cpufreq_powersave.c
drivers/cpufreq/cpufreq_userspace.c
include/linux/cpufreq.h
kernel/sched/cpufreq_schedutil.c