]> www.infradead.org Git - users/jedix/linux-maple.git/commit
regulator: core: Resolve supply using of_node from regulator_config
authorKory Maincent (Dent Project) <kory.maincent@bootlin.com>
Thu, 9 Jan 2025 10:18:07 +0000 (11:18 +0100)
committerMark Brown <broonie@kernel.org>
Thu, 9 Jan 2025 16:52:30 +0000 (16:52 +0000)
commitc3ad22ad34f81a8906dba02ea8cc9756d2ce7b50
treed168d34f971ef3abf798a5cecde6536638502321
parentdddca3b2fc676113c58b04aaefe84bfb958ac83e
regulator: core: Resolve supply using of_node from regulator_config

Previously, the regulator core resolved its supply only from the parent
device or its children, ignoring the of_node specified in the
regulator_config structure.
This behavior causes issues in scenarios where multiple regulator devices
are registered for components described as children of a controller, each
with their own specific regulator supply.

For instance, in a PSE controller with multiple PIs (Power Interfaces),
each PI may have a distinct regulator supply. However, the regulator core
would incorrectly use the PSE controller node or its first child to look up
the regulator supply, rather than the node specified by the
regulator_config->of_node for the PI.

This update modifies the behavior to prioritize the of_node in
regulator_config for resolving the supply. This ensures correct resolution
of the power supply for each device. If no supply is found in the provided
of_node, the core falls back to searching within the parent device as
before.

Reviewed-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
Link: https://patch.msgid.link/20250109-b4-feature_poe_arrange-v2-13-55ded947b510@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/core.c