diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index bd8b1f79dce2..a1a85f0baf7c 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -2615,8 +2615,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; }