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