Skip to content

Commit e23c0a5

Browse files
andredbroonie
authored andcommitted
regulator: core: don't ignore errors from event forwarding setup
Receiving and forwarding critical supply events seems like they're important information and we shouldn't ignore errors occurring during registration for such events. With this change the supply is unset on event registration failure, allowing us to potentially retry another time. Fixes: 433e294 ("regulator: core: forward undervoltage events downstream by default") Signed-off-by: André Draszik <andre.draszik@linaro.org> Link: https://patch.msgid.link/20260109-regulators-defer-v2-6-1a25dc968e60@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent bdbdc4b commit e23c0a5

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

drivers/regulator/core.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2273,10 +2273,21 @@ static int regulator_resolve_supply(struct regulator_dev *rdev)
22732273
* under-voltage.
22742274
*/
22752275
ret = register_regulator_event_forwarding(rdev);
2276-
if (ret < 0)
2276+
if (ret < 0) {
2277+
struct regulator *supply;
2278+
22772279
rdev_warn(rdev, "Failed to register event forwarding: %pe\n",
22782280
ERR_PTR(ret));
22792281

2282+
supply = rdev->supply;
2283+
rdev->supply = NULL;
2284+
2285+
regulator_unlock_two(rdev, supply->rdev, &ww_ctx);
2286+
2287+
regulator_put(supply);
2288+
goto out;
2289+
}
2290+
22802291
regulator_unlock_two(rdev, r, &ww_ctx);
22812292

22822293
/* rdev->supply was created in set_supply() */

0 commit comments

Comments
 (0)