regulator: max77620: Use device_set_of_node_from_dev()

The MAX77620 driver fails to re-probe on deferred probe because driver
core tries to claim resources that are already claimed by the PINCTRL
device. Use device_set_of_node_from_dev() helper which marks OF node as
reused, skipping erroneous execution of pinctrl_bind_pins() for the PMIC
device on the re-probe.

Fixes: aea6cb9970 ("regulator: resolve supply after creating regulator")
Signed-off-by: Dmitry Osipenko <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
This commit is contained in:
Dmitry Osipenko authored and Mark Brown committed 2021-05-24 09:50:19 +01:00
1 parent 36cb555fae
commit 6f55c5dd11
1 file changed
+7
+7
View File
@@ -814,6 +814,13 @@ static int max77620_regulator_probe(struct platform_device *pdev)
config.dev = dev;
config.driver_data = pmic;
/*
* Set of_node_reuse flag to prevent driver core from attempting to
* claim any pinmux resources already claimed by the parent device.
* Otherwise PMIC driver will fail to re-probe.
*/
device_set_of_node_from_dev(&pdev->dev, pdev->dev.parent);
for (id = 0; id < MAX77620_NUM_REGS; id++) {
struct regulator_dev *rdev;
struct regulator_desc *rdesc;