diff options
author | Mark Brown <broonie@kernel.org> | 2021-05-24 12:54:44 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2021-05-24 12:54:44 +0100 |
commit | a072cbda97a9367a84d46e7bf78a47abdbfcaea8 (patch) | |
tree | 5c4adb41eaeebf1db8cbb44bf1951d3e9025189a /drivers/regulator | |
parent | 8d6ee30c11a95f84974c2d7f590a7012f27b8f15 (diff) | |
parent | 62499a94ce5b9a41047dbadaad885347b1176079 (diff) | |
download | linux-stable-a072cbda97a9367a84d46e7bf78a47abdbfcaea8.tar.gz |
Merge series "Fix MAX77620 regulator driver regression" from Dmitry Osipenko <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
Diffstat (limited to 'drivers/regulator')
-rw-r--r-- | drivers/regulator/max77620-regulator.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/regulator/max77620-regulator.c b/drivers/regulator/max77620-regulator.c index 8d9731e4052b..3cf8f085170a 100644 --- a/drivers/regulator/max77620-regulator.c +++ b/drivers/regulator/max77620-regulator.c @@ -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; @@ -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; |