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: Carlos Song <[email protected]> Reviewed-by: Frank Li <[email protected]> --- drivers/spi/spi-imx.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c index 012f5bcbf73f..186963d3d2e0 100644 --- a/drivers/spi/spi-imx.c +++ b/drivers/spi/spi-imx.c @@ -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; } -- 2.34.1
