dmaengine: omap-dma: Simplify omap_dma_start_sg parameter list

We can drop the (sg)idx parameter for the omap_dma_start_sg() function and
increment the sgidx inside of the same function.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
This commit is contained in:
Peter Ujfalusi 2016-07-20 11:50:27 +03:00 committed by Vinod Koul
parent 29b4817d40
commit a5dc3fcac4

View File

@ -365,10 +365,9 @@ static void omap_dma_stop(struct omap_chan *c)
c->running = false; c->running = false;
} }
static void omap_dma_start_sg(struct omap_chan *c, struct omap_desc *d, static void omap_dma_start_sg(struct omap_chan *c, struct omap_desc *d)
unsigned idx)
{ {
struct omap_sg *sg = d->sg + idx; struct omap_sg *sg = d->sg + c->sgidx;
unsigned cxsa, cxei, cxfi; unsigned cxsa, cxei, cxfi;
if (d->dir == DMA_DEV_TO_MEM || d->dir == DMA_MEM_TO_MEM) { if (d->dir == DMA_DEV_TO_MEM || d->dir == DMA_MEM_TO_MEM) {
@ -388,6 +387,7 @@ static void omap_dma_start_sg(struct omap_chan *c, struct omap_desc *d,
omap_dma_chan_write(c, CFN, sg->fn); omap_dma_chan_write(c, CFN, sg->fn);
omap_dma_start(c, d); omap_dma_start(c, d);
c->sgidx++;
} }
static void omap_dma_start_desc(struct omap_chan *c) static void omap_dma_start_desc(struct omap_chan *c)
@ -433,7 +433,7 @@ static void omap_dma_start_desc(struct omap_chan *c)
omap_dma_chan_write(c, CSDP, d->csdp); omap_dma_chan_write(c, CSDP, d->csdp);
omap_dma_chan_write(c, CLNK_CTRL, d->clnk_ctrl); omap_dma_chan_write(c, CLNK_CTRL, d->clnk_ctrl);
omap_dma_start_sg(c, d, 0); omap_dma_start_sg(c, d);
} }
static void omap_dma_callback(int ch, u16 status, void *data) static void omap_dma_callback(int ch, u16 status, void *data)
@ -446,8 +446,8 @@ static void omap_dma_callback(int ch, u16 status, void *data)
d = c->desc; d = c->desc;
if (d) { if (d) {
if (!c->cyclic) { if (!c->cyclic) {
if (++c->sgidx < d->sglen) { if (c->sgidx < d->sglen) {
omap_dma_start_sg(c, d, c->sgidx); omap_dma_start_sg(c, d);
} else { } else {
omap_dma_start_desc(c); omap_dma_start_desc(c);
vchan_cookie_complete(&d->vd); vchan_cookie_complete(&d->vd);