diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/dma/fsldma.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c index 70126a606239..86d6da47f558 100644 --- a/drivers/dma/fsldma.c +++ b/drivers/dma/fsldma.c | |||
@@ -158,7 +158,8 @@ static void dma_start(struct fsl_dma_chan *fsl_chan) | |||
158 | 158 | ||
159 | static void dma_halt(struct fsl_dma_chan *fsl_chan) | 159 | static void dma_halt(struct fsl_dma_chan *fsl_chan) |
160 | { | 160 | { |
161 | int i = 0; | 161 | int i; |
162 | |||
162 | DMA_OUT(fsl_chan, &fsl_chan->reg_base->mr, | 163 | DMA_OUT(fsl_chan, &fsl_chan->reg_base->mr, |
163 | DMA_IN(fsl_chan, &fsl_chan->reg_base->mr, 32) | FSL_DMA_MR_CA, | 164 | DMA_IN(fsl_chan, &fsl_chan->reg_base->mr, 32) | FSL_DMA_MR_CA, |
164 | 32); | 165 | 32); |
@@ -166,8 +167,11 @@ static void dma_halt(struct fsl_dma_chan *fsl_chan) | |||
166 | DMA_IN(fsl_chan, &fsl_chan->reg_base->mr, 32) & ~(FSL_DMA_MR_CS | 167 | DMA_IN(fsl_chan, &fsl_chan->reg_base->mr, 32) & ~(FSL_DMA_MR_CS |
167 | | FSL_DMA_MR_EMS_EN | FSL_DMA_MR_CA), 32); | 168 | | FSL_DMA_MR_EMS_EN | FSL_DMA_MR_CA), 32); |
168 | 169 | ||
169 | while (!dma_is_idle(fsl_chan) && (i++ < 100)) | 170 | for (i = 0; i < 100; i++) { |
171 | if (dma_is_idle(fsl_chan)) | ||
172 | break; | ||
170 | udelay(10); | 173 | udelay(10); |
174 | } | ||
171 | if (i >= 100 && !dma_is_idle(fsl_chan)) | 175 | if (i >= 100 && !dma_is_idle(fsl_chan)) |
172 | dev_err(fsl_chan->dev, "DMA halt timeout!\n"); | 176 | dev_err(fsl_chan->dev, "DMA halt timeout!\n"); |
173 | } | 177 | } |