Skip to content

Commit

Permalink
dmaengine: axi-dmac: remove use of sg_nents_for_dma()
Browse files Browse the repository at this point in the history
The discussion around this helper ended up being that it's only a
"band-aid" fix instead of a better API solution that would make this helper
un-needed.
It would have been accepted, but the AXI DMAC would have been the only user
of this, and the benefit of adding this would have been small.

So, this patch removes the use of the helper. Maybe at a later point in
time a good solution would be found.

Signed-off-by: Alexandru Ardelean <[email protected]>
  • Loading branch information
commodo committed Mar 27, 2019
1 parent 6af5e44 commit 1106532
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/dma/dma-axi-dmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,10 @@ static struct dma_async_tx_descriptor *axi_dmac_prep_slave_sg(
if (direction != chan->direction)
return NULL;

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

desc = axi_dmac_alloc_desc(num_sgs);
if (!desc)
return NULL;
Expand Down

0 comments on commit 1106532

Please sign in to comment.