diff options
author | Anson Huang <Anson.Huang@nxp.com> | 2020-02-17 17:42:55 +0800 |
---|---|---|
committer | Viresh Kumar <viresh.kumar@linaro.org> | 2020-02-17 16:15:31 +0530 |
commit | a30f8a91f3c25ad7df897bf7877bad410ad19f79 (patch) | |
tree | 329849a3b202969cb235981975e964cb50c12473 /drivers/cpufreq | |
parent | 0ea4fb29c68950fbeea4e507e3c59ea35bb98ffd (diff) | |
download | linux-a30f8a91f3c25ad7df897bf7877bad410ad19f79.tar.gz linux-a30f8a91f3c25ad7df897bf7877bad410ad19f79.tar.bz2 linux-a30f8a91f3c25ad7df897bf7877bad410ad19f79.zip |
cpufreq: imx-cpufreq-dt: Add "cpu-supply" property check
The cpufreq-dt driver allows cpufreq driver enabled without valid
regulator assigned, however, all i.MX platforms using cpufreq-dt
driver now require valid regulator, add "cpu-supply" property check
to avoid i.MX platforms' cpufreq enabled without valid regulator
and lead to system unstable.
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r-- | drivers/cpufreq/imx-cpufreq-dt.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/cpufreq/imx-cpufreq-dt.c b/drivers/cpufreq/imx-cpufreq-dt.c index 6cb8193421ea..0e29d88618c9 100644 --- a/drivers/cpufreq/imx-cpufreq-dt.c +++ b/drivers/cpufreq/imx-cpufreq-dt.c @@ -31,6 +31,9 @@ static int imx_cpufreq_dt_probe(struct platform_device *pdev) int speed_grade, mkt_segment; int ret; + if (!of_find_property(cpu_dev->of_node, "cpu-supply", NULL)) + return -ENODEV; + ret = nvmem_cell_read_u32(cpu_dev, "speed_grade", &cell_value); if (ret) return ret; |