cpufreq: Clean up default and fallback governor setup
The preprocessor magic used for setting the default cpufreq governor (and for using the performance governor as a fallback one for that matter) is really nasty, so replace it with __weak functions and overrides. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Saravana Kannan <skannan@codeaurora.org> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
This commit is contained in:
@@ -33,10 +33,7 @@ static int cpufreq_governor_performance(struct cpufreq_policy *policy,
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_CPU_FREQ_GOV_PERFORMANCE_MODULE
|
||||
static
|
||||
#endif
|
||||
struct cpufreq_governor cpufreq_gov_performance = {
|
||||
static struct cpufreq_governor cpufreq_gov_performance = {
|
||||
.name = "performance",
|
||||
.governor = cpufreq_governor_performance,
|
||||
.owner = THIS_MODULE,
|
||||
@@ -52,6 +49,19 @@ static void __exit cpufreq_gov_performance_exit(void)
|
||||
cpufreq_unregister_governor(&cpufreq_gov_performance);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE
|
||||
struct cpufreq_governor *cpufreq_default_governor(void)
|
||||
{
|
||||
return &cpufreq_gov_performance;
|
||||
}
|
||||
#endif
|
||||
#ifndef CONFIG_CPU_FREQ_GOV_PERFORMANCE_MODULE
|
||||
struct cpufreq_governor *cpufreq_fallback_governor(void)
|
||||
{
|
||||
return &cpufreq_gov_performance;
|
||||
}
|
||||
#endif
|
||||
|
||||
MODULE_AUTHOR("Dominik Brodowski <linux@brodo.de>");
|
||||
MODULE_DESCRIPTION("CPUfreq policy governor 'performance'");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
Reference in New Issue
Block a user