Re: [PATCH] soundwire: Correct ifdef for stub functions
From: Charles Keepax
Date: Wed Jun 17 2026 - 05:06:54 EST
On Mon, Jun 15, 2026 at 04:49:04PM +0100, Charles Keepax wrote:
> On Mon, Jun 15, 2026 at 04:05:22PM +0100, Charles Keepax wrote:
> > Currently the stubs for SoundWire functions are enabled using
> > IS_ENABLED(). The trouble is if a driver intends to use the stubs
> > it by definition also does not depend on SOUNDWIRE. This means a
> > state can arise where SOUNDWIRE=m and DRIVER_CALLING_STUBS=y,
> > leading to a link time failure. Update the stubs to use
> > IS_REACHABLE such that the stubs will still be used in the
> > above situation.
>
> Feels like maybe I should have noted this can happen say for a
> driver that has two control interfaces. For example the rt5682
> (in the test robot report) has both an I2C and a SDW. If only the
> I2C is selected but the driver calls stubbed functions from
> common code. Typically these are gated in some way so they arn't
> actually called in the non-soundwire case.
>
> An alternative would be to add a dependency onto the driver to
> ensure the two modules are compatible, but this felt like it
> would cover more cases.
Having this weight on my mind for a few days, think I am going to
switch to just adding the dependencies on the affected drivers.
So please disregard this patch.
Thanks,
Charles