summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Dooks <ben.dooks@codethink.co.uk>2015-03-16 11:38:43 +0000
committerBen Dooks <ben.dooks@codethink.co.uk>2015-03-17 09:17:01 +0000
commit85f758c15016b609308e040cb6fbdaf7138004ec (patch)
treeabf32e90e5b32e216c851a116b675f7af0ed3444
parenta0df39ead1a41afdfccb88930ff72c22490d878f (diff)
downloadlinux-85f758c15016b609308e040cb6fbdaf7138004ec.tar.gz
dmaengine: pl330: fix return status on pending transfers
The pl330_tx_status() function returns the desc->status if the dma_cookie_status() call does indicate the cookie completed, however the desc->status is not look directly compatible. Sparse throws the following warning: pl330.c:2262:35: warning: mixing different enum types pl330.c:2262:35: int enum desc_status versus pl330.c:2262:35: int enum dma_status Attempt to fix this by adding a switch statement to turn the desc->status into a dma_status. Note, this has only been tested with the dmatest suite. Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk> -- CC: Vinod Koul <vinod.koul@intel.com> CC: Dan Williams <dan.j.williams@intel.com> CC: DMA List <dmaengine@vger.kernel.org> CC: Maxime Ripard <maxime.ripard@free-electrons.com> CC: Jassi Brar <jassisinghbrar@gmail.com> CC: Liviu Dudau <Liviu.Dudau@arm.com> CC: Linux ARM Kernel <linux-arm-kernel@lists.infradead.org>
-rw-r--r--drivers/dma/pl330.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index d6f677e066f7..a7d9d3029b14 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -2259,7 +2259,17 @@ pl330_tx_status(struct dma_chan *chan, dma_cookie_t cookie,
transferred = 0;
residual += desc->bytes_requested - transferred;
if (desc->txd.cookie == cookie) {
- ret = desc->status;
+ switch (desc->status) {
+ case DONE:
+ ret = DMA_COMPLETE;
+ break;
+ case PREP:
+ case BUSY:
+ ret = DMA_IN_PROGRESS;
+ break;
+ default:
+ WARN_ON(1);
+ }
break;
}
if (desc->last)