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

Commit a58f4242 authored by Stephen Boyd's avatar Stephen Boyd Committed by Rohit Gupta
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>
parent 4eb3c2ef
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -349,7 +349,7 @@ static int msm_cpufreq_probe(struct platform_device *pdev)
	char clk_name[] = "cpu??_clk";
	char tbl_name[] = "qcom,cpufreq-table-??";
	struct clk *c;
	int cpu;
	int cpu, ret;
	struct cpufreq_frequency_table *ftbl;

	l2_clk = devm_clk_get(dev, "l2_clk");
@@ -416,7 +416,15 @@ static int msm_cpufreq_probe(struct platform_device *pdev)
		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[] = {
@@ -452,8 +460,7 @@ static int __init msm_cpufreq_register(void)
		return rc;
	}

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

subsys_initcall(msm_cpufreq_register);