diff options
Diffstat (limited to 'drivers/cpufreq/cpufreq.c')
-rw-r--r-- | drivers/cpufreq/cpufreq.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index be78c07f72ca..d3575f5ec6d2 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
@@ -118,9 +118,11 @@ static void handle_update(struct work_struct *work); | |||
118 | static BLOCKING_NOTIFIER_HEAD(cpufreq_policy_notifier_list); | 118 | static BLOCKING_NOTIFIER_HEAD(cpufreq_policy_notifier_list); |
119 | static struct srcu_notifier_head cpufreq_transition_notifier_list; | 119 | static struct srcu_notifier_head cpufreq_transition_notifier_list; |
120 | 120 | ||
121 | static bool init_cpufreq_transition_notifier_list_called; | ||
121 | static int __init init_cpufreq_transition_notifier_list(void) | 122 | static int __init init_cpufreq_transition_notifier_list(void) |
122 | { | 123 | { |
123 | srcu_init_notifier_head(&cpufreq_transition_notifier_list); | 124 | srcu_init_notifier_head(&cpufreq_transition_notifier_list); |
125 | init_cpufreq_transition_notifier_list_called = true; | ||
124 | return 0; | 126 | return 0; |
125 | } | 127 | } |
126 | pure_initcall(init_cpufreq_transition_notifier_list); | 128 | pure_initcall(init_cpufreq_transition_notifier_list); |
@@ -1367,6 +1369,8 @@ int cpufreq_register_notifier(struct notifier_block *nb, unsigned int list) | |||
1367 | { | 1369 | { |
1368 | int ret; | 1370 | int ret; |
1369 | 1371 | ||
1372 | WARN_ON(!init_cpufreq_transition_notifier_list_called); | ||
1373 | |||
1370 | switch (list) { | 1374 | switch (list) { |
1371 | case CPUFREQ_TRANSITION_NOTIFIER: | 1375 | case CPUFREQ_TRANSITION_NOTIFIER: |
1372 | ret = srcu_notifier_chain_register( | 1376 | ret = srcu_notifier_chain_register( |