Skip to content

Commit d7d5aeb

Browse files
TerryGengkartben
authored andcommitted
drivers: spi: spi_pico_pio: Prevent dma_config check if DMA is not enabled
At this moment, DMA for SPI 3-wire half-duplex operation is not supported by the pio driver. A check was implemented there to prevent user from enabling DMA, but wasn't bypassed when CONFIG_SPI_RPI_PICO_PIO_DMA is not enabled at all, under which the `dma_config` structure isn't defined at all. Fixed #94897. Signed-off-by: Terry Geng <[email protected]>
1 parent 3c8eeea commit d7d5aeb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/spi/spi_rpi_pico_pio.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,10 +320,12 @@ static int spi_pico_pio_configure(const struct spi_pico_pio_config *dev_cfg,
320320

321321
#if SPI_RPI_PICO_PIO_HALF_DUPLEX_ENABLED
322322
if (spi_cfg->operation & SPI_HALF_DUPLEX) {
323+
#if defined(CONFIG_SPI_RPI_PICO_PIO_DMA)
323324
if (dev_cfg->dma_config.dev) {
324325
LOG_ERR("DMA not supported in 3-wire operation");
325326
return -ENOTSUP;
326327
}
328+
#endif
327329

328330
if ((cpol != 0) || (cpha != 0)) {
329331
LOG_ERR("Only mode (0, 0) supported in 3-wire SIO");

0 commit comments

Comments
 (0)