Message ID | 1367334782-32484-1-git-send-email-nm@ti.com (mailing list archive) |
---|---|
State | Changes Requested, archived |
Headers | show |
On 30 April 2013 20:43, Nishanth Menon <nm@ti.com> wrote: > Acked-by: Viresh Kumar <viresh.kumar@linaro.org> My earlier Ack was a waste of money :) > diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.c > index 37d23a0..e472167 100644 > --- a/drivers/cpufreq/cpufreq-cpu0.c > +++ b/drivers/cpufreq/cpufreq-cpu0.c > @@ -200,6 +200,20 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev) > cpu_dev = &pdev->dev; > cpu_dev->of_node = np; > > + cpu_reg = devm_regulator_get(cpu_dev, "cpu0"); > + if (IS_ERR(cpu_reg)) { > + /* > + * If cpu0 regulator supply node is present, but regulator is > + * not yet registered, we should try defering probe. > + */ > + if (PTR_ERR(cpu_reg) == -EPROBE_DEFER) { > + dev_err(cpu_dev, "cpu0 regulator not ready, retry\n"); > + return -EPROBE_DEFER; You need to do following here: of_node_put(np); of_node_put(parent); better mark ret = -EPROBE_DEFER; and do a goto out_put_node. -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.c index 37d23a0..e472167 100644 --- a/drivers/cpufreq/cpufreq-cpu0.c +++ b/drivers/cpufreq/cpufreq-cpu0.c @@ -200,6 +200,20 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev) cpu_dev = &pdev->dev; cpu_dev->of_node = np; + cpu_reg = devm_regulator_get(cpu_dev, "cpu0"); + if (IS_ERR(cpu_reg)) { + /* + * If cpu0 regulator supply node is present, but regulator is + * not yet registered, we should try defering probe. + */ + if (PTR_ERR(cpu_reg) == -EPROBE_DEFER) { + dev_err(cpu_dev, "cpu0 regulator not ready, retry\n"); + return -EPROBE_DEFER; + } + pr_err("failed to get cpu0 regulator: %ld\n", PTR_ERR(cpu_reg)); + cpu_reg = NULL; + } + cpu_clk = devm_clk_get(cpu_dev, NULL); if (IS_ERR(cpu_clk)) { ret = PTR_ERR(cpu_clk); @@ -207,12 +221,6 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev) goto out_put_node; } - cpu_reg = devm_regulator_get(cpu_dev, "cpu0"); - if (IS_ERR(cpu_reg)) { - pr_warn("failed to get cpu0 regulator\n"); - cpu_reg = NULL; - } - ret = of_init_opp_table(cpu_dev); if (ret) { pr_err("failed to init OPP table: %d\n", ret);