From c3a04bd26e9d9e2e160a0535e9ab6114e0efd7a9 Mon Sep 17 00:00:00 2001 From: Ranjani Vaidyanathan Date: Thu, 12 Sep 2013 14:44:20 -0500 Subject: ENGR00279545 [MX6x:Cpufreq] Initialize mutex before driver registration 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 --- drivers/cpufreq/cpufreq-imx6.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/cpufreq/cpufreq-imx6.c b/drivers/cpufreq/cpufreq-imx6.c index 51861d668ee3..eb7baacf6fdf 100644 --- a/drivers/cpufreq/cpufreq-imx6.c +++ b/drivers/cpufreq/cpufreq-imx6.c @@ -441,15 +441,15 @@ static int imx6_cpufreq_probe(struct platform_device *pdev) 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; -- cgit v1.2.2