aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuri Lelli <juri.lelli@arm.com>2015-11-18 11:16:12 +0000
committerJuri Lelli <juri.lelli@arm.com>2015-11-18 11:16:12 +0000
commit90d8fafd828258e2e73bdfa907c8bfeaa41a22bc (patch)
treea34ebee5c2dcd77952726d86cf468af71cb693f5
parent5e581816d5be9c56a05630c04d42b574618e5ca5 (diff)
downloadlinux-linaro-stable-v3.18/topic/EAS.tar.gz
sched/cpufreq_sched: properly handle config as modulev3.18/topic/EAS
When cpufreq_sched is built as a module we have to handle it properly. Add related fixes. Signed-off-by: Juri Lelli <juri.lelli@arm.com>
-rw-r--r--kernel/sched/cpufreq_sched.c10
-rw-r--r--kernel/sched/sched.h2
2 files changed, 8 insertions, 4 deletions
diff --git a/kernel/sched/cpufreq_sched.c b/kernel/sched/cpufreq_sched.c
index 8c5ad48..e6de060 100644
--- a/kernel/sched/cpufreq_sched.c
+++ b/kernel/sched/cpufreq_sched.c
@@ -343,7 +343,11 @@ static void __exit cpufreq_sched_exit(void)
cpufreq_unregister_governor(&cpufreq_gov_sched);
}
-/* Try to make this the default governor */
-fs_initcall(cpufreq_sched_init);
-
MODULE_LICENSE("GPL v2");
+
+#ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_SCHED
+fs_initcall(cpufreq_sched_init);
+#else
+module_init(cpufreq_sched_init);
+#endif
+module_exit(cpufreq_sched_exit);
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 216d5a8..9153b9d 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -1423,7 +1423,7 @@ static inline bool sched_energy_freq(void)
{
return static_key_false(&__sched_energy_freq);
}
-#ifdef CONFIG_CPU_FREQ_GOV_SCHED
+#if IS_ENABLED(CONFIG_CPU_FREQ_GOV_SCHED)
void cpufreq_sched_set_cap(int cpu, unsigned long util);
void cpufreq_sched_reset_cap(int cpu);
#else