Re: [RFC PATCH 2/7] regulator: Add devm helpers for get and enable

From: Mark Brown
Date: Wed Aug 10 2022 - 07:57:03 EST


On Wed, Aug 10, 2022 at 02:29:55PM +0300, Matti Vaittinen wrote:
> A few regulator consumer drivers seem to be just getting a regulator,
> enabling it and registering a devm-action to disable the regulator at
> the driver detach and then forget about it.
>
> We can simplify this a bit by adding a devm-helper for this pattern.
> Add devm_regulator_get_enable() and devm_regulator_get_enable_optional()

I'm really not keen on the idea of a devm managed enable, it's too prone
to bugs when someone gets round to implementing runtime PM.

Attachment: signature.asc
Description: PGP signature