diff options
author | Irina Tirdea <irina.tirdea@nxp.com> | 2017-02-02 15:24:59 +0200 |
---|---|---|
committer | Leonard Crestez <leonard.crestez@nxp.com> | 2018-08-24 12:41:33 +0300 |
commit | 956c695fe810b97cba8ed059d0b00cd36ff8244d (patch) | |
tree | ca58a063e19dfac853856c21a9bd42622315ab3b /drivers/cpufreq | |
parent | fb72a661a126d5d120b9256cddb5bc1d7ccd9f4b (diff) |
MLK-13793-1 cpufreq: imx6q: Return regulator error in probe
If there are any errors in getting the cpu0 regulators, the driver returns
-ENOENT. In case the regulators are not yet available, the devm_regulator_get
calls will return -EPROBE_DEFER, so that the driver can be probed later.
If we return -ENOENT, the driver will fail its initialization and will
not try to probe again (when the regulators become available).
Return the actual error received from regulator_get in probe. Print a
differentiated message in case we need to probe the device later and
in case we actually failed. Also add a message to inform when the
driver has been successfully registered.
Signed-off-by: Irina Tirdea <irina.tirdea@nxp.com>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r-- | drivers/cpufreq/imx6q-cpufreq.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c index 3c2a30f7d0ea..006e6e267ddd 100644 --- a/drivers/cpufreq/imx6q-cpufreq.c +++ b/drivers/cpufreq/imx6q-cpufreq.c @@ -359,8 +359,11 @@ static int imx6q_cpufreq_probe(struct platform_device *pdev) pu_reg = devm_regulator_get_optional(cpu_dev, "pu"); soc_reg = devm_regulator_get(cpu_dev, "soc"); if (IS_ERR(arm_reg) || IS_ERR(soc_reg)) { - dev_err(cpu_dev, "failed to get regulators\n"); - ret = -ENOENT; + ret = IS_ERR(arm_reg)?PTR_ERR(arm_reg):PTR_ERR(soc_reg); + if (ret == -EPROBE_DEFER) + dev_warn(cpu_dev, "regulators not ready, retry\n"); + else + dev_err(cpu_dev, "failed to get regulators: %d\n", ret); goto put_node; } @@ -517,6 +520,7 @@ soc_opp_out: register_pm_notifier(&imx6_cpufreq_pm_notifier); of_node_put(np); + dev_info(cpu_dev, "Registered imx6q-cpufreq\n"); return 0; free_freq_table: |