ARM: OMAP: dma: Fix the dma_chan_link_map init order
authorR Sricharan <r.sricharan@ti.com>
Thu, 13 Jun 2013 14:17:10 +0000 (19:47 +0530)
committerTony Lindgren <tony@atomide.com>
Tue, 18 Jun 2013 07:09:26 +0000 (00:09 -0700)
Init dma_chan_link_map[lch] *after* its memset to 0.

Signed-off-by: R Sricharan <r.sricharan@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/plat-omap/dma.c

index 2f993315646522b30db6d8edd0e07c0dd09be31f..8a71f7536f29d1e1269f7d72a6efe2fe0708f839 100644 (file)
@@ -894,11 +894,12 @@ void omap_start_dma(int lch)
                int next_lch, cur_lch;
                char dma_chan_link_map[MAX_LOGICAL_DMA_CH_COUNT];
 
-               dma_chan_link_map[lch] = 1;
                /* Set the link register of the first channel */
                enable_lnk(lch);
 
                memset(dma_chan_link_map, 0, sizeof(dma_chan_link_map));
+               dma_chan_link_map[lch] = 1;
+
                cur_lch = dma_chan[lch].next_lch;
                do {
                        next_lch = dma_chan[cur_lch].next_lch;