mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-03 23:58:05 +00:00
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: ffa7bdf7f3
("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>
This commit is contained in:
parent
be4b61ec45
commit
d2394860b4
1 changed files with 6 additions and 2 deletions
|
@ -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. */
|
/* Both presence and absence of sram regulator are valid cases. */
|
||||||
info->sram_reg = regulator_get_optional(cpu_dev, "sram");
|
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;
|
info->sram_reg = NULL;
|
||||||
else {
|
} else {
|
||||||
ret = regulator_enable(info->sram_reg);
|
ret = regulator_enable(info->sram_reg);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
dev_warn(cpu_dev, "cpu%d: failed to enable vsram\n", cpu);
|
dev_warn(cpu_dev, "cpu%d: failed to enable vsram\n", cpu);
|
||||||
|
|
Loading…
Reference in a new issue