Skip to content

Commit eaffb10

Browse files
nfrapradovireshk
authored andcommitted
cpufreq: mediatek-hw: Don't error out if supply is not found
devm_regulator_get_optional() returns -ENODEV if no supply can be found. By introducing its usage, commit 788715b ("cpufreq: mediatek-hw: Wait for CPU supplies before probing") caused the driver to fail probe if no supply was present in any of the CPU DT nodes. Use devm_regulator_get() instead since the CPUs do require supplies even if not described in the DT. It will gracefully return a dummy regulator if none is found in the DT node, allowing probe to succeed. Fixes: 788715b ("cpufreq: mediatek-hw: Wait for CPU supplies before probing") Reported-by: kernelci.org bot <bot@kernelci.org> Closes: https://linux.kernelci.org/test/case/id/65b0b169710edea22852a3fa/ Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
1 parent 9ac3eba commit eaffb10

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/cpufreq/mediatek-cpufreq-hw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ static int mtk_cpufreq_hw_driver_probe(struct platform_device *pdev)
312312
return dev_err_probe(&pdev->dev, -EPROBE_DEFER,
313313
"Failed to get cpu%d device\n", cpu);
314314

315-
cpu_reg = devm_regulator_get_optional(cpu_dev, "cpu");
315+
cpu_reg = devm_regulator_get(cpu_dev, "cpu");
316316
if (IS_ERR(cpu_reg))
317317
return dev_err_probe(&pdev->dev, PTR_ERR(cpu_reg),
318318
"CPU%d regulator get failed\n", cpu);

0 commit comments

Comments
 (0)