Skip to content

Commit

Permalink
Merge series "Fix MAX77620 regulator driver regression" from Dmitry O…
Browse files Browse the repository at this point in the history
…sipenko <digetx@gmail.com>:

Hi,

The next-20210521 started to fail on Nexus 7 because of the change to
regulator core that caused regression of the MAX77620 regulator driver.
The regulator driver is now getting a deferred probe and turned out
driver wasn't ready for this. The root of the problem is that OF node
of the PMIC MFD sub-device is shared with the PINCTRL sub-device and we
need to convey this information to the driver core, otherwise it will
try to claim GPIO pin that is already claimed by PINCTRL and fail the
probe.

Dmitry Osipenko (2):
  regulator: max77620: Use device_set_of_node_from_dev()
  regulator: max77620: Silence deferred probe error

 drivers/regulator/max77620-regulator.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

--
2.30.2
  • Loading branch information
Mark Brown committed May 24, 2021
2 parents 8d6ee30 + 62499a9 commit a072cbd
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions drivers/regulator/max77620-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -839,12 +846,10 @@ static int max77620_regulator_probe(struct platform_device *pdev)
return ret;

rdev = devm_regulator_register(dev, rdesc, &config);
if (IS_ERR(rdev)) {
ret = PTR_ERR(rdev);
dev_err(dev, "Regulator registration %s failed: %d\n",
rdesc->name, ret);
return ret;
}
if (IS_ERR(rdev))
return dev_err_probe(dev, PTR_ERR(rdev),
"Regulator registration %s failed\n",
rdesc->name);
}

return 0;
Expand Down

0 comments on commit a072cbd

Please sign in to comment.