From 2eb27275fc723de7e67be7e9d4fc0e8a0c69d081 Mon Sep 17 00:00:00 2001 From: Saravana Kannan Date: Thu, 13 Feb 2014 19:08:21 -0800 Subject: [PATCH] cpufreq: cpu-boost: Don't register for cpufreq notifiers too early The cpufreq notifiers should be registered only after all the data structures used in the notifier callbacks have been initialized. So, move the cpufreq notifier registration to a later point in the init function. Change-Id: I043ab5bc0ebb98164c40549fe151a8d801c8c186 Signed-off-by: Saravana Kannan --- drivers/cpufreq/cpu-boost.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/cpufreq/cpu-boost.c b/drivers/cpufreq/cpu-boost.c index 179cb179b019..f6695636435f 100644 --- a/drivers/cpufreq/cpu-boost.c +++ b/drivers/cpufreq/cpu-boost.c @@ -338,8 +338,6 @@ static int cpu_boost_init(void) int cpu, ret; struct cpu_sync *s; - cpufreq_register_notifier(&boost_adjust_nb, CPUFREQ_POLICY_NOTIFIER); - cpu_boost_wq = alloc_workqueue("cpuboost_wq", WQ_HIGHPRI, 0); if (!cpu_boost_wq) return -EFAULT; @@ -357,10 +355,11 @@ static int cpu_boost_init(void) "boost_sync/%d", cpu); set_cpus_allowed(s->thread, *cpumask_of(cpu)); } + cpufreq_register_notifier(&boost_adjust_nb, CPUFREQ_POLICY_NOTIFIER); atomic_notifier_chain_register(&migration_notifier_head, &boost_migration_nb); - ret = input_register_handler(&cpuboost_input_handler); + return 0; } late_initcall(cpu_boost_init);