Commit 024ae9d3 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Vinod Koul
Browse files

dmaengine: axi-dmac: use sg_nents_for_dma() helper



Instead of open coded variant let's use recently introduced helper.

Reviewed-by: default avatarBjorn Andersson <andersson@kernel.org>
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: default avatarNuno Sá <nuno.sa@analog.com>
Link: https://patch.msgid.link/20260108105619.3513561-4-andriy.shevchenko@linux.intel.com


Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent 47f5cb78
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -677,10 +677,7 @@ static struct dma_async_tx_descriptor *axi_dmac_prep_slave_sg(
	if (direction != chan->direction)
		return NULL;

	num_sgs = 0;
	for_each_sg(sgl, sg, sg_len, i)
		num_sgs += DIV_ROUND_UP(sg_dma_len(sg), chan->max_length);

	num_sgs = sg_nents_for_dma(sgl, sg_len, chan->max_length);
	desc = axi_dmac_alloc_desc(chan, num_sgs);
	if (!desc)
		return NULL;