Re: [PATCH] iio: accel: fxls8962af: fix i2c dependency

From: Andy Shevchenko
Date: Wed Jul 21 2021 - 13:34:01 EST


On Wed, Jul 21, 2021 at 7:12 PM Arnd Bergmann <arnd@xxxxxxxxxx> wrote:
> On Wed, Jul 21, 2021 at 5:52 PM Andy Shevchenko
> <andy.shevchenko@xxxxxxxxx> wrote:
> > On Wed, Jul 21, 2021 at 6:13 PM Arnd Bergmann <arnd@xxxxxxxxxx> wrote:

...

> > > config FXLS8962AF
> > > tristate
> > > + depends on I2C || !I2C # cannot be built-in for modular I2C
> >
> > Can you enlighten me how this will not be a no-op?
>
> This part does nothing, it only causes a warning when FXLS8962AF
> gets selected =y when I2C=m.

This is something new to me. But shouldn't the other chunk guarantee
that warning won't happen?

> The important bit is the other hunk that adds the same dependency
> to the FXLS8962AF_SPI symbol, which enforces that either I2C
> is completely disabled, or treated as a dependency that prevents
> the user from setting FXLS8962AF_SPI=y when that would cause
> a link failure.

This part I understand and neither object to nor comment on.

> The effect is similar to a 'depends on SND_SOC_I2C_AND_SPI',
> except we only need it on the SPI symbol here because the SPI
> core cannot be in a module itself.

I see. Thanks for elaboration.

--
With Best Regards,
Andy Shevchenko