|
@@ -195,6 +195,22 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev)
|
|
cpu_dev = &pdev->dev;
|
|
cpu_dev = &pdev->dev;
|
|
cpu_dev->of_node = np;
|
|
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");
|
|
|
|
+ ret = -EPROBE_DEFER;
|
|
|
|
+ goto out_put_node;
|
|
|
|
+ }
|
|
|
|
+ pr_warn("failed to get cpu0 regulator: %ld\n",
|
|
|
|
+ PTR_ERR(cpu_reg));
|
|
|
|
+ cpu_reg = NULL;
|
|
|
|
+ }
|
|
|
|
+
|
|
cpu_clk = devm_clk_get(cpu_dev, NULL);
|
|
cpu_clk = devm_clk_get(cpu_dev, NULL);
|
|
if (IS_ERR(cpu_clk)) {
|
|
if (IS_ERR(cpu_clk)) {
|
|
ret = PTR_ERR(cpu_clk);
|
|
ret = PTR_ERR(cpu_clk);
|
|
@@ -202,12 +218,6 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev)
|
|
goto out_put_node;
|
|
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);
|
|
ret = of_init_opp_table(cpu_dev);
|
|
if (ret) {
|
|
if (ret) {
|
|
pr_err("failed to init OPP table: %d\n", ret);
|
|
pr_err("failed to init OPP table: %d\n", ret);
|