Re: [PATCH 2/6] ASoC: wm8995: Register regulator notifiers from the bus probe
From: Charles Keepax
Date: Mon Sep 14 2026 - 11:19:56 EST
On Sun, Sep 13, 2026 at 07:15:27PM +0900, Chancel Liu wrote:
> From: Chancel Liu <chancel.liu@xxxxxxx>
>
> wm8995 requests its regulator supplies and registers the regulator
> disable notifiers from the ASoC component probe, but the associated
> devres cleanup is tied to the underlying I2C/SPI device.
>
> These resources are only mishandled when the sound card is unregistered
> and re-registered while the bus device stays bound. On that path the
> component probe runs again and re-registers the same notifier_block on
> the still-registered regulator notifier chain and corrupts the chain.
>
> Move the supply request and notifier registration into a helper,
> wm8995_hw_init(), and call it from wm8995_i2c_probe() and
> wm8995_spi_probe() so they run once per bus device bind. The regulator
> enable and the register accesses that need the component stay in
> wm8995_probe().
>
> Signed-off-by: Chancel Liu <chancel.liu@xxxxxxx>
> ---
Reviewed-by: Charles Keepax <ckeepax@xxxxxxxxxxxxxxxxxxxxx>
Thanks,
Charles