diff options
| author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2026-01-08 13:50:14 +0300 |
|---|---|---|
| committer | Vinod Koul <vkoul@kernel.org> | 2026-01-09 06:06:00 +0300 |
| commit | 024ae9d3092c425f3ea6eae92086a2001ca2e0c7 (patch) | |
| tree | 55438468d92b0e26e10a7860ca77dc5c9af1eeea | |
| parent | 47f5cb7878cc62ed95981c5d02862b253eddb590 (diff) | |
| download | linux-024ae9d3092c425f3ea6eae92086a2001ca2e0c7.tar.xz | |
dmaengine: axi-dmac: 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>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Link: https://patch.msgid.link/20260108105619.3513561-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
| -rw-r--r-- | drivers/dma/dma-axi-dmac.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/dma/dma-axi-dmac.c b/drivers/dma/dma-axi-dmac.c index 045e9b9a90df..f5caf75dc0e7 100644 --- a/drivers/dma/dma-axi-dmac.c +++ b/drivers/dma/dma-axi-dmac.c @@ -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; |
