arm:lpc32xx:dma: Fix variants of spin_lock/spin_unlock used in driver
authorBangaragiri G <bangaragiri.g@nxp.com>
Fri, 26 Aug 2011 19:53:57 +0000 (12:53 -0700)
committerKevin Wells <wellsk40@gmail.com>
Fri, 26 Aug 2011 19:53:57 +0000 (12:53 -0700)
arch/arm/mach-lpc32xx/dma.c

index 0db3357..3dfec4b 100644 (file)
@@ -81,15 +81,16 @@ struct dma_control {
        struct dma_channel dma_channels[MAX_DMA_CHANNELS];
 };
 static struct dma_control dma_ctrl;
+static unsigned long flags;
 
 static inline void __dma_regs_lock(void)
 {
-       spin_lock_irq(&dma_lock);
+       spin_lock_irqsave(&dma_lock, flags);
 }
 
 static inline void __dma_regs_unlock(void)
 {
-       spin_unlock_irq(&dma_lock);
+       spin_unlock_irqrestore(&dma_lock, flags);
 }
 
 static inline void __dma_enable(int ch) {
@@ -622,7 +623,7 @@ EXPORT_SYMBOL_GPL(lpc32xx_get_free_llist_entry);
 int lpc32xx_dma_start_xfer(int ch, u32 config)
 {
        struct dma_list_ctrl *plhead;
-       
+
        if ((!VALID_CHANNEL(ch)) || (dma_ctrl.dma_channels[ch].name == NULL) ||
                (dma_ctrl.dma_channels[ch].list_vstart == 0))
                return -1;