Re: [PATCH v3 2/3] ASoC: codecs: wsa883x: Add devm action to safely disable regulator on device removal

From: Krzysztof Kozlowski
Date: Sun Jul 27 2025 - 05:30:31 EST


On 27/07/2025 10:31, Mohammad Rafi Shaik wrote:
> To prevent potential warnings from _regulator_put() during device

Warning is either there or not. Either you fix real, specific issue or
not. The code looks correct at first glance, so please describe exactly
how these warnings happen or how what is the bug being fixed.

> removal, register a devm-managed cleanup action using
> devm_add_action_or_reset() to safely disable the regulator
> associated with the WSA883x codec, ensuring that the regulator
> is properly disabled when the device is removed, even if the

Device cannot be removed/unloaded, AFAIK, because of suppressed bind.
Regulator is already disabled during error paths, so that part of above
sentences is just misleading.

How can one trigger the warnings?


> probe fails or the driver is unloaded unexpectedly.

How driver can be unloaded unexpectedly?

Best regards,
Krzysztof