aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor@chromium.org>2014-12-16 18:09:39 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-12-17 19:43:28 -0500
commit62a041a4f58f32989460e37cb4f9aed5183f357f (patch)
tree22b2885321bacd41bf2bceac866d38cf8c432d71
parent437574c9cb523d9f329f22fd04877cdde793d1d5 (diff)
cpufreq-dt: defer probing if OPP table is not ready
cpufreq-dt driver supports mode when OPP table is provided by platform code and not device tree. However on certain platforms code that fills OPP table may run after cpufreq driver tries to initialize, so let's report -EPROBE_DEFER if we do not find any entires in OPP table for the CPU. Signed-off-by: Dmitry Torokhov <dtor@chromium.org> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/cpufreq/cpufreq-dt.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c
index 9bc2720628a4..538abd50b77c 100644
--- a/drivers/cpufreq/cpufreq-dt.c
+++ b/drivers/cpufreq/cpufreq-dt.c
@@ -211,6 +211,17 @@ static int cpufreq_init(struct cpufreq_policy *policy)
211 /* OPPs might be populated at runtime, don't check for error here */ 211 /* OPPs might be populated at runtime, don't check for error here */
212 of_init_opp_table(cpu_dev); 212 of_init_opp_table(cpu_dev);
213 213
214 /*
215 * But we need OPP table to function so if it is not there let's
216 * give platform code chance to provide it for us.
217 */
218 ret = dev_pm_opp_get_opp_count(cpu_dev);
219 if (ret <= 0) {
220 pr_debug("OPP table is not ready, deferring probe\n");
221 ret = -EPROBE_DEFER;
222 goto out_free_opp;
223 }
224
214 priv = kzalloc(sizeof(*priv), GFP_KERNEL); 225 priv = kzalloc(sizeof(*priv), GFP_KERNEL);
215 if (!priv) { 226 if (!priv) {
216 ret = -ENOMEM; 227 ret = -ENOMEM;