Re: [PATCH v2 2/2] mfd: cs42l43: Move to core detach helper

From: Charles Keepax

Date: Wed Sep 16 2026 - 14:00:47 EST


On Wed, Sep 16, 2026 at 04:21:48PM +0100, Lee Jones wrote:
> On Mon, 31 Aug 2026, Charles Keepax wrote:
> > Now the core has a helper to signal a device will detach from
> > the SoundWire bus, there is no need for the cs42l43 driver code
> > to separately track that. Switch to using the new core helper.
> >
> > Signed-off-by: Charles Keepax <ckeepax@xxxxxxxxxxxxxxxxxxxxx>
> > ---
> > case SDW_SLAVE_UNATTACHED:
> > dev_dbg(cs42l43->dev, "Device detach\n");
>
> Is this now superfluous?

It is still very useful to see attach/detach when debugging the
driver, so I would very much like to keep the print. The function
still has to do twiddling the IRQ mask on attach so its not like
the function exists only to do the debug prints.

> > - reinit_completion(&cs42l43->device_detach);
> > + sdw_slave_signal_unattach(cs42l43->sdw);
>
> If this call NULL safe?

Yup.

+static inline void sdw_slave_signal_unattach(struct sdw_slave *slave)
+{
+ if (!slave)
+ return;

Thanks,
Charles