The mutex, set_cpufreq_lock, should be initialized before the driver is
registered. Else if the default governor is set to performance or ondemand,
the cpufreq driver will try to set the freq to the max freq supported and
this will cause a crash during boot.
Signed-off-by: Ranjani Vaidyanathan <ra5478@freescale.com>
if (ret > 0)
transition_latency += ret * 1000;
+ mutex_init(&set_cpufreq_lock);
+ register_pm_notifier(&imx6_cpufreq_pm_notifier);
+
ret = cpufreq_register_driver(&imx6_cpufreq_driver);
if (ret) {
dev_err(cpu_dev, "failed register driver: %d\n", ret);
goto free_freq_table;
}
- mutex_init(&set_cpufreq_lock);
- register_pm_notifier(&imx6_cpufreq_pm_notifier);
-
of_node_put(np);
return 0;