mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 03:04:51 +01:00
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>
This commit is contained in:
parent
ac326dca68
commit
3c8a86ed00
1 changed files with 2 additions and 4 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue