summaryrefslogtreecommitdiff
path: root/drivers/dma
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2026-01-08 11:50:24 +0100
committerVinod Koul <vkoul@kernel.org>2026-01-09 08:36:01 +0530
commit3c8a86ed002ab8fb287ee4ec92f0fd6ac5b291d2 (patch)
treea72ed48e3847185a68929d9fd494f8290d9490fb /drivers/dma
parentac326dca6870f0d8e0787e94b1d9c2c91bb358d7 (diff)
dmaengine: xilinx: xdma: use sg_nents_for_dma() helper
Instead of open coded variant let's use recently introduced helper. Reviewed-by: Bjorn Andersson <andersson@kernel.org> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://patch.msgid.link/20260108105619.3513561-14-andriy.shevchenko@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/dma')
-rw-r--r--drivers/dma/xilinx/xdma.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/dma/xilinx/xdma.c b/drivers/dma/xilinx/xdma.c
index 0d88b1a670e1..be6c22e1020a 100644
--- a/drivers/dma/xilinx/xdma.c
+++ b/drivers/dma/xilinx/xdma.c
@@ -605,13 +605,11 @@ xdma_prep_device_sg(struct dma_chan *chan, struct scatterlist *sgl,
struct xdma_chan *xdma_chan = to_xdma_chan(chan);
struct dma_async_tx_descriptor *tx_desc;
struct xdma_desc *sw_desc;
- u32 desc_num = 0, i;
u64 addr, dev_addr, *src, *dst;
+ u32 desc_num, i;
struct scatterlist *sg;
- for_each_sg(sgl, sg, sg_len, i)
- desc_num += DIV_ROUND_UP(sg_dma_len(sg), XDMA_DESC_BLEN_MAX);
-
+ desc_num = sg_nents_for_dma(sgl, sg_len, XDMA_DESC_BLEN_MAX);
sw_desc = xdma_alloc_desc(xdma_chan, desc_num, false);
if (!sw_desc)
return NULL;