diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 862a9bb6912984d076c25d7ed92f8acea8fbf1f2..2e5dca20c8d00b4e659637819b059f7aea9c1aa4 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -2612,8 +2612,9 @@ static int spi_get_gpio_descs(struct spi_controller *ctlr) } ctlr->unused_native_cs = ffz(native_cs_mask); - if (num_cs_gpios && ctlr->max_native_cs && - ctlr->unused_native_cs >= ctlr->max_native_cs) { + + if ((ctlr->flags & SPI_MASTER_GPIO_SS) && num_cs_gpios && + ctlr->max_native_cs && ctlr->unused_native_cs >= ctlr->max_native_cs) { dev_err(dev, "No unused native chip select available\n"); return -EINVAL; }