Re: [PATCH v3 3/3] ASoC: codecs: lpass-wsa-macro: Use devm_clk_hw_register() for MCLK output

From: Konrad Dybcio

Date: Mon May 11 2026 - 07:15:36 EST


On 5/8/26 1:35 PM, Ajay Kumar Nandam wrote:
> The WSA macro driver registers the MCLK output clock using
> clk_hw_register(), but does not explicitly unregister it in the remove
> path or on probe failure.
>
> Switch to devm_clk_hw_register() to make the registration resource-managed
> so the clk_hw is automatically unregistered when the device is unbound or
> probe fails. This avoids lifetime and cleanup issues and simplifies error
> handling.
>
> No functional change intended.

This is a bit of a semantic argument, but the driver will now behave
differently, since as you explained above, .remove does not currently
unregister the clock (but devres will now do that)

> Signed-off-by: Ajay Kumar Nandam <ajay.nandam@xxxxxxxxxxxxxxxx>
> ---

Reviewed-by: Konrad Dybcio <konrad.dybcio@xxxxxxxxxxxxxxxx>

Konrad