diff options
author | Ben Dooks <ben.dooks@codethink.co.uk> | 2015-03-16 07:52:45 -0400 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2015-03-18 13:11:49 -0400 |
commit | 75967b788c2898601620ce91ed14b4a9a371b6fe (patch) | |
tree | 395d247b694ea917bc2bcefb06d08c579c9c69a5 /drivers/dma | |
parent | 5503aed8117881f58a2688521dfbf9fc7dbcdfe7 (diff) |
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>
--
Vinod Koul <vinod.koul@intel.com>
Dan Williams <dan.j.williams@intel.com>
DMA List <dmaengine@vger.kernel.org>
Maxime Ripard <maxime.ripard@free-electrons.com>
Jassi Brar <jassisinghbrar@gmail.com>
Liviu Dudau <Liviu.Dudau@arm.com>
Linux ARM Kernel <linux-arm-kernel@lists.infradead.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma')
-rw-r--r-- | drivers/dma/pl330.c | 12 |
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, | |||
2259 | transferred = 0; | 2259 | transferred = 0; |
2260 | residual += desc->bytes_requested - transferred; | 2260 | residual += desc->bytes_requested - transferred; |
2261 | if (desc->txd.cookie == cookie) { | 2261 | if (desc->txd.cookie == cookie) { |
2262 | ret = desc->status; | 2262 | switch (desc->status) { |
2263 | case DONE: | ||
2264 | ret = DMA_COMPLETE; | ||
2265 | break; | ||
2266 | case PREP: | ||
2267 | case BUSY: | ||
2268 | ret = DMA_IN_PROGRESS; | ||
2269 | break; | ||
2270 | default: | ||
2271 | WARN_ON(1); | ||
2272 | } | ||
2263 | break; | 2273 | break; |
2264 | } | 2274 | } |
2265 | if (desc->last) | 2275 | if (desc->last) |