Skip to content

Commit 11574c0

Browse files
pdgendtnashif
authored andcommitted
drivers: spi: sam: Fix DMA build
A MACRO argument naming mismatch causes a bug when trying to use DMA. Fix the MACRO argument and conditional DMA configuration. Signed-off-by: Pieter De Gendt <[email protected]>
1 parent 341c01f commit 11574c0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/spi/spi_sam.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,11 @@ static const struct spi_driver_api spi_sam_driver_api = {
720720
.dma_rx_channel = DT_INST_DMAS_CELL_BY_NAME(n, rx, channel), \
721721
.dma_rx_perid = DT_INST_DMAS_CELL_BY_NAME(n, rx, perid),
722722

723-
#define SPI_SAM_USE_DMA(inst) DT_INST_DMAS_HAS_NAME(n, tx) && IS_ENABLED(CONFIG_SPI_SAM_DMA)
723+
#ifdef CONFIG_SPI_SAM_DMA
724+
#define SPI_SAM_USE_DMA(n) DT_INST_DMAS_HAS_NAME(n, tx)
725+
#else
726+
#define SPI_SAM_USE_DMA(n) 0
727+
#endif
724728

725729
#define SPI_SAM_DEFINE_CONFIG(n) \
726730
static const struct spi_sam_config spi_sam_config_##n = { \

0 commit comments

Comments
 (0)