Skip to content

Commit

Permalink
dmaengine: sun6i-dma: Only calculate residue if state exists.
Browse files Browse the repository at this point in the history
There is no point in calculating the residue if state does not
exist to store the value.

Signed-off-by: Peter Griffin <[email protected]>
Signed-off-by: Vinod Koul <[email protected]>
  • Loading branch information
petegriffin authored and Vinod Koul committed Jun 21, 2016
1 parent a90e56e commit b9ab9d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/dma/sun6i-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ static enum dma_status sun6i_dma_tx_status(struct dma_chan *chan,
size_t bytes = 0;

ret = dma_cookie_status(chan, cookie, state);
if (ret == DMA_COMPLETE)
if (ret == DMA_COMPLETE || !state)
return ret;

spin_lock_irqsave(&vchan->vc.lock, flags);
Expand Down

0 comments on commit b9ab9d1

Please sign in to comment.