diff options
author | Jacky Bai <ping.bai@nxp.com> | 2020-05-07 11:04:47 +0800 |
---|---|---|
committer | Jacky Bai <ping.bai@nxp.com> | 2020-05-07 13:38:42 +0800 |
commit | 52aa8b0564d37d2be66fb44c15ad9dd92f1e3efe (patch) | |
tree | 39c11678dbdaa8afeaf81a39d654d676ae9ae052 | |
parent | f51e2308f27b4f1d3057aa49672967228670d6d9 (diff) |
MLK-23888 cpufreq: imx7ulp: Fix cpufreq probe failure due to defer probe
It is possible that the regulator_get will return defer probe error if
the regulator is not ready when cpufreq doing probe. cpufreq need to
defer probe again if regulator_get return '-EPROBE_DEFER', so fix it.
Signed-off-by: Jacky Bai <ping.bai@nxp.com>
Reviewed-by: Anson Huang <anson.huang@nxp.com>
-rw-r--r-- | drivers/cpufreq/imx7ulp-cpufreq.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/cpufreq/imx7ulp-cpufreq.c b/drivers/cpufreq/imx7ulp-cpufreq.c index 43a9b9520ae9..04b0a27c49bf 100644 --- a/drivers/cpufreq/imx7ulp-cpufreq.c +++ b/drivers/cpufreq/imx7ulp-cpufreq.c @@ -170,9 +170,10 @@ static int imx7ulp_cpufreq_probe(struct platform_device *pdev) arm_reg = regulator_get(cpu_dev, "arm"); if (IS_ERR(arm_reg)) { - dev_err(cpu_dev, "failed to get regulator\n"); - ret = -ENOENT; - goto put_reg; + if (PTR_ERR(arm_reg) != -EPROBE_DEFER) + dev_err(cpu_dev, "failed to get regulator\n"); + ret = PTR_ERR(arm_reg); + goto put_clk; } ret = dev_pm_opp_of_add_table(cpu_dev); |