Skip to content

Commit e09bd57

Browse files
AngeloGioacchino Del Regnochanwoochoi
authored andcommitted
PM / devfreq: mtk-cci: 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: b615b00 ("PM / devfreq: mediatek: Introduce MediaTek CCI devfreq driver") Signed-off-by: AngeloGioacchino Del Regno <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
1 parent 521a547 commit e09bd57

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/devfreq/mtk-cci-devfreq.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,9 +291,13 @@ static int mtk_ccifreq_probe(struct platform_device *pdev)
291291
}
292292

293293
drv->sram_reg = devm_regulator_get_optional(dev, "sram");
294-
if (IS_ERR(drv->sram_reg))
294+
if (IS_ERR(drv->sram_reg)) {
295+
ret = PTR_ERR(drv->sram_reg);
296+
if (ret == -EPROBE_DEFER)
297+
goto out_free_resources;
298+
295299
drv->sram_reg = NULL;
296-
else {
300+
} else {
297301
ret = regulator_enable(drv->sram_reg);
298302
if (ret) {
299303
dev_err(dev, "failed to enable sram regulator\n");

0 commit comments

Comments
 (0)