summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandru Ardelean <alexandru.ardelean@analog.com>2018-10-29 12:08:08 +0200
committerVinod Koul <vkoul@kernel.org>2018-11-24 19:16:46 +0530
commit0255200bd29afc320c6ea4c1adf8bdc13a9b3c15 (patch)
tree8d1fa236e495028d2b1ce7219847fc97f48840ce
parent651022382c7f8da46cb4872a545ee1da6d097d2a (diff)
dmaengine: dmatest: unmap data on a single code-path when xfer done
After the DMA transfer is done, we don't need to call the un-mapping code in 3 places. One is enough. Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Vinod Koul <vkoul@kernel.org>
-rw-r--r--drivers/dma/dmatest.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c
index aa1712beb0cc..5d4b1e053fb7 100644
--- a/drivers/dma/dmatest.c
+++ b/drivers/dma/dmatest.c
@@ -721,14 +721,14 @@ static int dmatest_func(void *data)
status = dma_async_is_tx_complete(chan, cookie, NULL, NULL);
+ dmaengine_unmap_put(um);
+
if (!done->done) {
- dmaengine_unmap_put(um);
result("test timed out", total_tests, src_off, dst_off,
len, 0);
failed_tests++;
continue;
} else if (status != DMA_COMPLETE) {
- dmaengine_unmap_put(um);
result(status == DMA_ERROR ?
"completion error status" :
"completion busy status", total_tests, src_off,
@@ -737,8 +737,6 @@ static int dmatest_func(void *data)
continue;
}
- dmaengine_unmap_put(um);
-
if (params->noverify) {
verbose_result("test passed", total_tests, src_off,
dst_off, len, 0);