On 20 October 2015 at 13:05, Lars-Peter Clausen <lars@xxxxxxxxxx> wrote: > On 10/20/2015 01:00 PM, Joachim Eastwood wrote: >> On 20 October 2015 at 10:05, Lars-Peter Clausen <lars@xxxxxxxxxx> wrote: >>> On 10/19/2015 09:00 PM, Joachim Eastwood wrote: >>> [...] >>>> +config MMA7455 >>>> + tristate "Freescale MMA7455L/MMA7456L Accelerometer Driver" >>>> + depends on I2C || SPI_MASTER >>>> + select IIO_BUFFER >>>> + select IIO_TRIGGERED_BUFFER >>>> + select MMA7455_I2C if I2C >>>> + select MMA7455_SPI if SPI >>> >>> Ah, damm, I shouldn't have said bmg160 is a good example without actually >>> looking at its Kconfig entry. Only saw the C files and those looked good. >>> >>> This is still problematic. The depends on clause allows this driver to be >>> built-in if either I2C is built-in or SPI_MASTER is built-in. And then the >>> respective I2C and SPI modules will also be selected as built-in even though >>> the I2C symbol is only selected as a module. So you now have built-in code >>> that tries to reference code that is only available as a module. >>> >>> A better solution is to make the Kconfig entries for the I2C and SPI modules >>> user selectable and then let them select the main module. >> >> Something like this: >> >> config MMA7455 >> tristate >> >> config MMA7455_I2C >> tristate "Freescale MMA7455L/MMA7456L Accelerometer I2C Driver" >> depends on I2C >> select IIO_BUFFER >> select IIO_TRIGGERED_BUFFER >> select MMA7455 >> select REGMAP_I2C >> help >> ... >> >> config MMA7455_SPI >> tristate "Freescale MMA7455L/MMA7456L Accelerometer SPI Driver" >> depends on SPI_MASTER >> select IIO_BUFFER >> select IIO_TRIGGERED_BUFFER >> select MMA7455 >> select REGMAP_SPI >> help >> ... > > Yes, but move the select IIO_BUFFER and IIO_TRIGGERED_BUFFER to the shared > symbol. ah, yes, that is better. Thanks. regards, Joachim Eastwood -- To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html