Skip to content

Commit f5c042b

Browse files
osctobebroonie
authored andcommitted
regulator: workaround self-referent regulators
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>
1 parent 4b639e2 commit f5c042b

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
@@ -1844,7 +1844,10 @@ static int regulator_resolve_supply(struct regulator_dev *rdev)
18441844
if (r == rdev) {
18451845
dev_err(dev, "Supply for %s (%s) resolved to itself\n",
18461846
rdev->desc->name, rdev->supply_name);
1847-
return -EINVAL;
1847+
if (!have_full_constraints())
1848+
return -EINVAL;
1849+
r = dummy_regulator_rdev;
1850+
get_device(&r->dev);
18481851
}
18491852

18501853
/*

0 commit comments

Comments
 (0)