Re: [PATCH v2 15/21] ASoC: codecs: wm8985: Move regulator acquisition to the bus probe

From: Charles Keepax

Date: Wed Sep 23 2026 - 05:20:54 EST


On Wed, Sep 23, 2026 at 03:12:59PM +0900, Chancel Liu wrote:
> From: Chancel Liu <chancel.liu@xxxxxxx>
>
> component->dev is the underlying i2c/spi device whose devres is only
> released on physical device removal, not on ASoC card unbind. Getting
> the regulator supplies with devm_regulator_bulk_get(component->dev, ...)
> in the component probe therefore leaks the regulator references on every
> card bind/unbind cycle.
>
> Move the devm_regulator_bulk_get() into a helper called from the i2c and
> spi probes so the supplies are tied to the physical device lifetime.
>
> Signed-off-by: Chancel Liu <chancel.liu@xxxxxxx>
> ---

Reviewed-by: Charles Keepax <ckeepax@xxxxxxxxxxxxxxxxxxxxx>

Thanks,
Charles