Skip to content

Commit d239486

Browse files
AngeloGioacchino Del Regnovireshk
authored andcommitted
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: ffa7bdf ("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>
1 parent be4b61e commit d239486

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/cpufreq/mediatek-cpufreq.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,9 +439,13 @@ static int mtk_cpu_dvfs_info_init(struct mtk_cpu_dvfs_info *info, int cpu)
439439

440440
/* Both presence and absence of sram regulator are valid cases. */
441441
info->sram_reg = regulator_get_optional(cpu_dev, "sram");
442-
if (IS_ERR(info->sram_reg))
442+
if (IS_ERR(info->sram_reg)) {
443+
ret = PTR_ERR(info->sram_reg);
444+
if (ret == -EPROBE_DEFER)
445+
goto out_free_resources;
446+
443447
info->sram_reg = NULL;
444-
else {
448+
} else {
445449
ret = regulator_enable(info->sram_reg);
446450
if (ret) {
447451
dev_warn(cpu_dev, "cpu%d: failed to enable vsram\n", cpu);

0 commit comments

Comments
 (0)