diff options
| author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2026-01-08 11:50:19 +0100 |
|---|---|---|
| committer | Vinod Koul <vkoul@kernel.org> | 2026-01-09 08:36:00 +0530 |
| commit | 068942eaa232ba752b744d98ff8ab22b26c8bff4 (patch) | |
| tree | ee15808767fe38bb1d56b1dc54ae638c88223540 | |
| parent | f9b0274f53a2d464e71f37e8f4d0d0dc41321259 (diff) | |
| download | linux-068942eaa232ba752b744d98ff8ab22b26c8bff4.tar.gz linux-068942eaa232ba752b744d98ff8ab22b26c8bff4.zip | |
dmaengine: pxa-dma: 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-9-andriy.shevchenko@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
| -rw-r--r-- | drivers/dma/pxa_dma.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/dma/pxa_dma.c b/drivers/dma/pxa_dma.c index 249296389771..b639c8b51e87 100644 --- a/drivers/dma/pxa_dma.c +++ b/drivers/dma/pxa_dma.c @@ -970,7 +970,7 @@ pxad_prep_slave_sg(struct dma_chan *dchan, struct scatterlist *sgl, struct scatterlist *sg; dma_addr_t dma; u32 dcmd, dsadr = 0, dtadr = 0; - unsigned int nb_desc = 0, i, j = 0; + unsigned int nb_desc, i, j = 0; if ((sgl == NULL) || (sg_len == 0)) return NULL; @@ -979,8 +979,7 @@ pxad_prep_slave_sg(struct dma_chan *dchan, struct scatterlist *sgl, dev_dbg(&chan->vc.chan.dev->device, "%s(): dir=%d flags=%lx\n", __func__, dir, flags); - for_each_sg(sgl, sg, sg_len, i) - nb_desc += DIV_ROUND_UP(sg_dma_len(sg), PDMA_MAX_DESC_BYTES); + nb_desc = sg_nents_for_dma(sgl, sg_len, PDMA_MAX_DESC_BYTES); sw_desc = pxad_alloc_desc(chan, nb_desc + 1); if (!sw_desc) return NULL; |
