drivers: spi: xmc4xxx: Fix potential runtime error

Fixes an unhandled interrupt runtime crash if CONFIG_SPI_XMC4XXX_DMA=y and
CONFIG_SPI_XMC4XXX_INTERRUPT=n.

The unhandled interrupt error is triggered because irq_enable() was called
without calling IRQ_CONNECT() when CONFIG_SPI_XMC4XXX_INTERRUPT=n.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
This commit is contained in:
Andriy Gelman 2023-09-28 18:55:51 -04:00 committed by Carles Cufí
parent 8246d14742
commit a34d4d1ce9
2 changed files with 2 additions and 1 deletions

View File

@ -468,7 +468,9 @@ static int spi_xmc4xxx_transceive_dma(const struct device *dev, const struct spi
spi_context_cs_control(ctx, false);
}
#if defined(CONFIG_SPI_XMC4XXX_INTERRUPT)
irq_enable(config->irq_num_rx);
#endif
spi_context_release(ctx, ret);
return ret;

View File

@ -1,3 +1,2 @@
CONFIG_SPI_XMC4XXX_INTERRUPT=y
CONFIG_SPI_XMC4XXX_DMA=y
CONFIG_SPI_LOOPBACK_MODE_LOOP=y