Skip to content

Commit a811a56

Browse files
osctobeksacilotto
authored andcommitted
regulator: workaround self-referent regulators
BugLink: https://bugs.launchpad.net/bugs/1908561 commit f5c042b upstream. Workaround regulators whose supply name happens to be the same as its own name. This fixes boards that used to work before the early supply resolving was removed. The error message is left in place so that offending drivers can be detected. Fixes: aea6cb9 ("regulator: resolve supply after creating regulator") Cc: stable@vger.kernel.org Reported-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Tested-by: Ahmad Fatoum <a.fatoum@pengutronix.de> # stpmic1 Link: https://lore.kernel.org/r/d703acde2a93100c3c7a81059d716c50ad1b1f52.1605226675.git.mirq-linux@rere.qmqm.pl Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Kamal Mostafa <kamal@canonical.com> Signed-off-by: Ian May <ian.may@canonical.com>
1 parent b22d855 commit a811a56

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/regulator/core.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1803,7 +1803,10 @@ static int regulator_resolve_supply(struct regulator_dev *rdev)
18031803
if (r == rdev) {
18041804
dev_err(dev, "Supply for %s (%s) resolved to itself\n",
18051805
rdev->desc->name, rdev->supply_name);
1806-
return -EINVAL;
1806+
if (!have_full_constraints())
1807+
return -EINVAL;
1808+
r = dummy_regulator_rdev;
1809+
get_device(&r->dev);
18071810
}
18081811

18091812
/*

0 commit comments

Comments
 (0)