aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/at_hdmac.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/dma/at_hdmac.c')
-rw-r--r--drivers/dma/at_hdmac.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
index c13a3bb0f594..ca9dd2613283 100644
--- a/drivers/dma/at_hdmac.c
+++ b/drivers/dma/at_hdmac.c
@@ -294,14 +294,16 @@ static int atc_get_bytes_left(struct dma_chan *chan)
294 ret = -EINVAL; 294 ret = -EINVAL;
295 goto out; 295 goto out;
296 } 296 }
297 atchan->remain_desc -= (desc_cur->lli.ctrla & ATC_BTSIZE_MAX) 297
298 << (desc_first->tx_width); 298 count = (desc_cur->lli.ctrla & ATC_BTSIZE_MAX)
299 if (atchan->remain_desc < 0) { 299 << desc_first->tx_width;
300 if (atchan->remain_desc < count) {
300 ret = -EINVAL; 301 ret = -EINVAL;
301 goto out; 302 goto out;
302 } else {
303 ret = atchan->remain_desc;
304 } 303 }
304
305 atchan->remain_desc -= count;
306 ret = atchan->remain_desc;
305 } else { 307 } else {
306 /* 308 /*
307 * Get residual bytes when current 309 * Get residual bytes when current
@@ -893,12 +895,11 @@ atc_dma_cyclic_fill_desc(struct dma_chan *chan, struct at_desc *desc,
893 * @period_len: number of bytes for each period 895 * @period_len: number of bytes for each period
894 * @direction: transfer direction, to or from device 896 * @direction: transfer direction, to or from device
895 * @flags: tx descriptor status flags 897 * @flags: tx descriptor status flags
896 * @context: transfer context (ignored)
897 */ 898 */
898static struct dma_async_tx_descriptor * 899static struct dma_async_tx_descriptor *
899atc_prep_dma_cyclic(struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len, 900atc_prep_dma_cyclic(struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len,
900 size_t period_len, enum dma_transfer_direction direction, 901 size_t period_len, enum dma_transfer_direction direction,
901 unsigned long flags, void *context) 902 unsigned long flags)
902{ 903{
903 struct at_dma_chan *atchan = to_at_dma_chan(chan); 904 struct at_dma_chan *atchan = to_at_dma_chan(chan);
904 struct at_dma_slave *atslave = chan->private; 905 struct at_dma_slave *atslave = chan->private;