Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d9d6c809 authored by Stephen Boyd's avatar Stephen Boyd Committed by Jonathan Avila
Browse files

qcom-cpufreq: Register cpufreq driver in driver probe



We don't handle probe defer very well in this driver. If the
platform_driver_register() call doesn't immediately probe the
driver there, or if that driver probe defers for some reason,
then the cpufreq driver registration in msm_cpufreq_register()
will fail due to a missing frequency table. Let's move the
cpufreq driver registration (and platform suspend hook part) into
the platform driver probe path, so we handle probe defer properly
and avoid any issues with order of initializations.

Change-Id: I14b514d46239f52b535563d49fb5c19d06072c3a
Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
Signed-off-by: default avatarRohit Gupta <rohgup@codeaurora.org>
Signed-off-by: default avatarJonathan Avila <avilaj@codeaurora.org>
parent f31cedbc
Loading
Loading
Loading
Loading
+11 −4
Original line number Original line Diff line number Diff line
@@ -343,7 +343,7 @@ static int msm_cpufreq_probe(struct platform_device *pdev)
	char clk_name[] = "cpu??_clk";
	char clk_name[] = "cpu??_clk";
	char tbl_name[] = "qcom,cpufreq-table-??";
	char tbl_name[] = "qcom,cpufreq-table-??";
	struct clk *c;
	struct clk *c;
	int cpu;
	int cpu, ret;
	struct cpufreq_frequency_table *ftbl;
	struct cpufreq_frequency_table *ftbl;


	l2_clk = devm_clk_get(dev, "l2_clk");
	l2_clk = devm_clk_get(dev, "l2_clk");
@@ -410,7 +410,15 @@ static int msm_cpufreq_probe(struct platform_device *pdev)
		per_cpu(freq_table, cpu) = ftbl;
		per_cpu(freq_table, cpu) = ftbl;
	}
	}


	return 0;
	ret = register_pm_notifier(&msm_cpufreq_pm_notifier);
	if (ret)
		return ret;

	ret = cpufreq_register_driver(&msm_cpufreq_driver);
	if (ret)
		unregister_pm_notifier(&msm_cpufreq_pm_notifier);

	return ret;
}
}


static const struct of_device_id msm_cpufreq_match_table[] = {
static const struct of_device_id msm_cpufreq_match_table[] = {
@@ -446,8 +454,7 @@ static int __init msm_cpufreq_register(void)
		return rc;
		return rc;
	}
	}


	register_pm_notifier(&msm_cpufreq_pm_notifier);
	return 0;
	return cpufreq_register_driver(&msm_cpufreq_driver);
}
}


subsys_initcall(msm_cpufreq_register);
subsys_initcall(msm_cpufreq_register);