]> git.baikalelectronics.ru Git - kernel.git/commit
regulator: vctrl: Use locked regulator_get_voltage in probe path
authorChen-Yu Tsai <wenst@chromium.org>
Wed, 25 Aug 2021 03:37:03 +0000 (11:37 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Sep 2021 07:47:29 +0000 (09:47 +0200)
commit415c986600e5eddef7a65fc1fc897b142a3d65fa
treeb1e69bc58308b48a44634f8495242ec7303a034d
parent823e5700782bef1710b419df508aa814dab63bb0
regulator: vctrl: Use locked regulator_get_voltage in probe path

[ Upstream commit 98e47570ba985f2310586c80409238200fa3170f ]

In commit 8168a596145c ("regulator: vctrl-regulator: Avoid deadlock getting
and setting the voltage"), all calls to get/set the voltage of the
control regulator were switched to unlocked versions to avoid deadlocks.
However, the call in the probe path is done without regulator locks
held. In this case the locked version should be used.

Switch back to the locked regulator_get_voltage() in the probe path to
avoid any mishaps.

Fixes: 8168a596145c ("regulator: vctrl-regulator: Avoid deadlock getting and setting the voltage")
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
Link: https://lore.kernel.org/r/20210825033704.3307263-2-wenst@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/regulator/vctrl-regulator.c