Skip to content

Commit 98e4757

Browse files
wensbroonie
authored andcommitted
regulator: vctrl: Use locked regulator_get_voltage in probe path
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]>
1 parent ad3ead1 commit 98e4757

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)