summaryrefslogtreecommitdiff
path: root/drivers/dma/sh/shdma-base.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/dma/sh/shdma-base.c')
-rw-r--r--drivers/dma/sh/shdma-base.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/dma/sh/shdma-base.c b/drivers/dma/sh/shdma-base.c
index 834741adadaa..3ff2a8be8faa 100644
--- a/drivers/dma/sh/shdma-base.c
+++ b/drivers/dma/sh/shdma-base.c
@@ -143,7 +143,7 @@ static dma_cookie_t shdma_tx_submit(struct dma_async_tx_descriptor *tx)
}
schan->pm_state = SHDMA_PM_ESTABLISHED;
- ret = pm_runtime_put(schan->dev);
+ pm_runtime_put(schan->dev);
spin_unlock_irq(&schan->chan_lock);
return ret;
@@ -577,12 +577,11 @@ static struct dma_async_tx_descriptor *shdma_prep_sg(struct shdma_chan *schan,
struct scatterlist *sg;
struct shdma_desc *first = NULL, *new = NULL /* compiler... */;
LIST_HEAD(tx_list);
- int chunks = 0;
+ int chunks;
unsigned long irq_flags;
int i;
- for_each_sg(sgl, sg, sg_len, i)
- chunks += DIV_ROUND_UP(sg_dma_len(sg), schan->max_xfer_len);
+ chunks = sg_nents_for_dma(sgl, sg_len, schan->max_xfer_len);
/* Have to lock the whole loop to protect against concurrent release */
spin_lock_irqsave(&schan->chan_lock, irq_flags);