Skip to content

Commit 1e672e2

Browse files
wensKelsey Skunberg
authored and
Kelsey Skunberg
committed
regulator: vctrl: Use locked regulator_get_voltage in probe path
BugLink: https://bugs.launchpad.net/bugs/1946024 [ Upstream commit 98e4757 ] In commit e915331 ("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: e915331 ("regulator: vctrl-regulator: Avoid deadlock getting and setting the voltage") Signed-off-by: Chen-Yu Tsai <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]> Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Kamal Mostafa <[email protected]> Signed-off-by: Kelsey Skunberg <[email protected]>
1 parent e810725 commit 1e672e2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/regulator/vctrl-regulator.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,8 @@ static int vctrl_probe(struct platform_device *pdev)
490490
if (ret)
491491
return ret;
492492

493-
ctrl_uV = regulator_get_voltage_rdev(vctrl->ctrl_reg->rdev);
493+
/* Use locked consumer API when not in regulator framework */
494+
ctrl_uV = regulator_get_voltage(vctrl->ctrl_reg);
494495
if (ctrl_uV < 0) {
495496
dev_err(&pdev->dev, "failed to get control voltage\n");
496497
return ctrl_uV;

0 commit comments

Comments
 (0)