drivers: spi: Fix SPI_2_NRF_SPIS-related dependency loop

The following dependency loop existed:

  config SPI_SLAVE
  	bool

  (Defined at drivers/spi/Kconfig:27)

  ...is selected by...

  config SPI_2_NRF_SPIS
  	bool
  	select SPI_SLAVE

  (Defined at drivers/spi/Kconfig.nrfx:210)

  ...is in the choice...

  choice
  	bool
  	depends on SPI_2

  (Defined at drivers/spi/Kconfig.nrfx:192)

  ...that depends on...

  config SPI_2
  	bool
  	depends on SPI_SLAVE

  (Defined at
  arch/x86/soc/intel_quark/quark_se/Kconfig.defconfig.series)

  ...that again depends on SPI_SLAVE

(This might not be a problem in practice, but it'd be difficult to
detect.)

I think the underlying issue is that SPI_2_NRF_SPIS 'select's SPI_SLAVE,
while SPI_2 'depends on' it.

Fix it by having SPI_2_NRF_SPIS 'depend on' SPI_SLAVE as well. This will
require SPI_SLAVE to be explicitly enabled before SPI_2_NRF_SPIS can be
enabled.

No configuration files in Zephyr itself seem to currently enable
SPI_2_NRF_SPIS (and it defaults to n), so no tweaks should be needed
there.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
This commit is contained in:
Ulf Magnusson 2018-06-19 23:56:53 +02:00 committed by Anas Nashif
commit d930c21e12

View file

@ -37,7 +37,7 @@ config SPI_0_NRF_SPIM
config SPI_0_NRF_SPIS
bool "nRF SPIS 0"
depends on SOC_SERIES_NRF52X
select SPI_SLAVE
depends on SPI_SLAVE
select NRFX_SPIS
help
Enable nRF SPI Slave with EasyDMA on port 0.
@ -124,7 +124,7 @@ config SPI_1_NRF_SPIM
config SPI_1_NRF_SPIS
bool "nRF SPIS 1"
depends on SOC_SERIES_NRF52X || SOC_SERIES_NRF51X
select SPI_SLAVE
depends on SPI_SLAVE
select NRFX_SPIS
help
Enable nRF SPI Slave with EasyDMA on port 1.
@ -210,7 +210,7 @@ config SPI_2_NRF_SPIM
config SPI_2_NRF_SPIS
bool "nRF SPIS 2"
depends on SOC_SERIES_NRF52X
select SPI_SLAVE
depends on SPI_SLAVE
select NRFX_SPIS
help
Enable nRF SPI Slave with EasyDMA on port 2.