cpufreq: Remove the weakly defined cpufreq_default_governor()

The default cpufreq governor is chosen with the help of a "choice"
option in the Kconfig which will always end up selecting one of
the governors and so the weakly defined definition of
cpufreq_default_governor() will never get called.

Moreover, this makes us skip the checking of the return value of
that routine as it will always be non NULL.

If the Kconfig option changes in future, then we will start getting
a link error instead (and it won't go unnoticed as in the case of the
weak definition).

Suggested-by: Quentin Perret <qperret@google.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
Viresh Kumar 2020-06-29 15:34:40 +05:30 committed by Rafael J. Wysocki
parent 8412b4563e
commit 3a7e4fbbfd
1 changed files with 0 additions and 7 deletions

View File

@ -1056,11 +1056,6 @@ static int cpufreq_add_dev_interface(struct cpufreq_policy *policy)
return 0; return 0;
} }
__weak struct cpufreq_governor *cpufreq_default_governor(void)
{
return NULL;
}
static int cpufreq_init_policy(struct cpufreq_policy *policy) static int cpufreq_init_policy(struct cpufreq_policy *policy)
{ {
struct cpufreq_governor *gov = NULL; struct cpufreq_governor *gov = NULL;
@ -1079,8 +1074,6 @@ static int cpufreq_init_policy(struct cpufreq_policy *policy)
if (!gov) { if (!gov) {
gov = cpufreq_default_governor(); gov = cpufreq_default_governor();
if (!gov)
return -ENODATA;
__module_get(gov->owner); __module_get(gov->owner);
} }