summaryrefslogtreecommitdiff
path: root/drivers/dma/omap-dma.c
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2016-07-20 11:50:28 +0300
committerVinod Koul <vinod.koul@intel.com>2016-08-10 22:59:12 +0530
commitb57ebe080cffb323b062fbff1a35ef59de3bd5d1 (patch)
tree4eac70de398cf813699972ea5fdc6858d4e6d338 /drivers/dma/omap-dma.c
parenta5dc3fcac4a29b77e8bd476b8b5242e8f449d3a6 (diff)
dmaengine: omap-dma: Simplify omap_dma_callback
Flatten the indentation level of the function which gives better view on the cases we handle here. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma/omap-dma.c')
-rw-r--r--drivers/dma/omap-dma.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c
index 2fdeb02e81fc..3c445942bd31 100644
--- a/drivers/dma/omap-dma.c
+++ b/drivers/dma/omap-dma.c
@@ -445,15 +445,13 @@ static void omap_dma_callback(int ch, u16 status, void *data)
spin_lock_irqsave(&c->vc.lock, flags);
d = c->desc;
if (d) {
- if (!c->cyclic) {
- if (c->sgidx < d->sglen) {
- omap_dma_start_sg(c, d);
- } else {
- omap_dma_start_desc(c);
- vchan_cookie_complete(&d->vd);
- }
- } else {
+ if (c->cyclic) {
vchan_cyclic_callback(&d->vd);
+ } else if (c->sgidx == d->sglen) {
+ omap_dma_start_desc(c);
+ vchan_cookie_complete(&d->vd);
+ } else {
+ omap_dma_start_sg(c, d);
}
}
spin_unlock_irqrestore(&c->vc.lock, flags);