Skip to content

Commit 3a7e4fb

Browse files
vireshkrafaeljw
authored andcommitted
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 <[email protected]> Signed-off-by: Viresh Kumar <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 8412b45 commit 3a7e4fb

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

drivers/cpufreq/cpufreq.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,11 +1056,6 @@ static int cpufreq_add_dev_interface(struct cpufreq_policy *policy)
10561056
return 0;
10571057
}
10581058

1059-
__weak struct cpufreq_governor *cpufreq_default_governor(void)
1060-
{
1061-
return NULL;
1062-
}
1063-
10641059
static int cpufreq_init_policy(struct cpufreq_policy *policy)
10651060
{
10661061
struct cpufreq_governor *gov = NULL;
@@ -1079,8 +1074,6 @@ static int cpufreq_init_policy(struct cpufreq_policy *policy)
10791074

10801075
if (!gov) {
10811076
gov = cpufreq_default_governor();
1082-
if (!gov)
1083-
return -ENODATA;
10841077
__module_get(gov->owner);
10851078
}
10861079

0 commit comments

Comments
 (0)