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)
committerGrazvydas Ignotas <notasas@gmail.com>
Sun, 7 Jun 2015 20:25:22 +0000 (23:25 +0300)
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 c9b5253..e3e3559 100644 (file)
@@ -882,11 +882,12 @@ void omap_start_dma(int lch)
                int next_lch, cur_lch;
                char dma_chan_link_map[dma_lch_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;