]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
cpufreq: mediatek-hw: Don't error out if supply is not found
authorNícolas F. R. A. Prado <nfraprado@collabora.com>
Wed, 24 Jan 2024 20:31:43 +0000 (17:31 -0300)
committerSasha Levin <sashal@kernel.org>
Tue, 26 Mar 2024 22:19:23 +0000 (18:19 -0400)
commitff1a989b4a2fc804f345a4352fdc2dc5c642ef9d
tree1fe8a29da5bb2bfa4719d78c033ffcdcfdb7a7be
parent01934a552cdbf6f3b7c6f0d7fa1c1c815b8ea513
cpufreq: mediatek-hw: Don't error out if supply is not found

[ Upstream commit eaffb10b51bf74415c9252fd8fb4dd77122501ee ]

devm_regulator_get_optional() returns -ENODEV if no supply can be found.
By introducing its usage, commit 788715b5f21c ("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: 788715b5f21c ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/cpufreq/mediatek-cpufreq-hw.c