Re: [PATCH v5 3/7] ASoC: SDCA: expose class SoundWire probe/remove as library

From: Charles Keepax

Date: Mon Sep 28 2026 - 05:40:05 EST


On Fri, Sep 25, 2026 at 05:10:44PM +0100, Srinivas Kandagatla wrote:
> Split the internal class_sdw_probe/class_sdw_remove functions into
> caller-friendly library helpers:
>
> sdca_class_probe(sdw, drv)
> sdca_class_remove(drv)
>
> The class_sdw_probe/class_sdw_remove callbacks of the built-in
> class_sdw_driver are now thin wrappers that allocate a bare
> sdca_class_drv, stash it in drvdata, and defer to the exported
> helpers.
>
> The exported sdca_class_probe() takes a caller-owned struct
> sdca_class_drv * so codec-specific SoundWire drivers can embed the
> class state in their own priv struct, own dev_set_drvdata() themselves,
> and avoid a second allocation. No functional change for the built-in
> driver.
>
> This lays the groundwork for codec-specific SDCA SoundWire drivers
> that want to compose the class-side probe with their own quirks; the
> next patches add the class_ops mechanism on top.
>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@xxxxxxxxxxxxxxxx>
> ---

Reviewed-by: Charles Keepax <ckeepax@xxxxxxxxxxxxxxxxxxxxx>

Thanks,
Charles