Re: [PATCH 3/5] regulator: core: Add mechanism to force disable a regulator at boot

From: Mark Brown

Date: Thu Oct 22 2026 - 09:54:16 EST


On Wed, Oct 21, 2026 at 12:27:44PM +0200, Paul Louvel wrote:
> Regulation activity may be enabled by default when the device powers up.
> A consumer may query the regulator's state during probe and may disable
> it if it is already enabled, potentially resulting in an unbalanced
> disable operation:
>
> ret = regulator_is_enabled();
> if (ret < 0)
> return ret;
>
> if (ret)
> ret = regulator_disable();
> ^^^^^^^^^^^^^^^^^^^^

As covered elsewhere this driver code is buggy. I can't see how to use
this feature sensibly, if a driver can safely disable the regulator on
startup it should just do that and if the regulator could be shared then
it has no idea why the regulator was enabled.

Attachment: signature.asc
Description: PGP signature