Unverified Commit a5f29858 authored by Carlos Song's avatar Carlos Song Committed by Mark Brown
Browse files

spi: imx: avoid dmaengine_terminate_all() on TX prep failure



If dmaengine_prep_slave_sg() fails, no descriptor is submitted to the TX
channel and DMA is never started. Therefore, calling
dmaengine_terminate_all() for the TX DMA channel is unnecessary.

Signed-off-by: default avatarCarlos Song <carlos.song@nxp.com>
Reviewed-by: default avatarFrank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20251203085949.2922166-4-carlos.song@nxp.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 5395bb7f
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -1468,7 +1468,6 @@ static int spi_imx_dma_submit(struct spi_imx_data *spi_imx,
					  tx->sgl, tx->nents, DMA_MEM_TO_DEV,
					  DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
	if (!desc_tx) {
		dmaengine_terminate_all(controller->dma_tx);
		dmaengine_terminate_all(controller->dma_rx);
		return -EINVAL;
	}