Re: [PATCH net v1] pse-core: Conditionally set current limit during PI regulator registration

From: Kory Maincent
Date: Wed Aug 14 2024 - 05:24:02 EST


On Tue, 13 Aug 2024 09:37:19 +0200
Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx> wrote:

> Fix an issue where `devm_regulator_register()` would fail for PSE
> controllers that do not support current limit control, such as simple
> GPIO-based controllers like the podl-pse-regulator. The
> `REGULATOR_CHANGE_CURRENT` flag and `max_uA` constraint are now
> conditionally set only if the `pi_set_current_limit` operation is
> supported. This change prevents the regulator registration routine from
> attempting to call `pse_pi_set_current_limit()`, which would return
> `-EOPNOTSUPP` and cause the registration to fail.

Thanks for the fix!

Reviewed-by: Kory Maincent <kory.maincent@xxxxxxxxxxx>

--
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com