diff options
author | AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> | 2022-07-13 14:15:36 +0300 |
---|---|---|
committer | Viresh Kumar <viresh.kumar@linaro.org> | 2022-07-13 14:21:32 +0300 |
commit | d2394860b45c3c1484e4b0a5d09909a1e3f6569e (patch) | |
tree | 926ae0e2a1a6bc3208b0bfe1533c7b5bd822db80 /drivers/cpufreq/mediatek-cpufreq.c | |
parent | be4b61ec45b3efe5e9077525fc92d544305eb2a6 (diff) | |
download | linux-d2394860b45c3c1484e4b0a5d09909a1e3f6569e.tar.xz |
cpufreq: mediatek: Handle sram regulator probe deferral
If the regulator_get_optional() call for the SRAM regulator returns
a probe deferral, we must bail out and retry probing later: failing
to do this will produce unstabilities on platforms requiring the
handling for this regulator.
Fixes: ffa7bdf7f344 ("cpufreq: mediatek: Make sram regulator optional")
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Diffstat (limited to 'drivers/cpufreq/mediatek-cpufreq.c')
-rw-r--r-- | drivers/cpufreq/mediatek-cpufreq.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/cpufreq/mediatek-cpufreq.c b/drivers/cpufreq/mediatek-cpufreq.c index 37a1eb20f5ba..76f6b3884e6b 100644 --- a/drivers/cpufreq/mediatek-cpufreq.c +++ b/drivers/cpufreq/mediatek-cpufreq.c @@ -439,9 +439,13 @@ static int mtk_cpu_dvfs_info_init(struct mtk_cpu_dvfs_info *info, int cpu) /* Both presence and absence of sram regulator are valid cases. */ info->sram_reg = regulator_get_optional(cpu_dev, "sram"); - if (IS_ERR(info->sram_reg)) + if (IS_ERR(info->sram_reg)) { + ret = PTR_ERR(info->sram_reg); + if (ret == -EPROBE_DEFER) + goto out_free_resources; + info->sram_reg = NULL; - else { + } else { ret = regulator_enable(info->sram_reg); if (ret) { dev_warn(cpu_dev, "cpu%d: failed to enable vsram\n", cpu); |