aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-mxc/dma-mx1-mx2.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/plat-mxc/dma-mx1-mx2.c')
-rw-r--r--arch/arm/plat-mxc/dma-mx1-mx2.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/arch/arm/plat-mxc/dma-mx1-mx2.c b/arch/arm/plat-mxc/dma-mx1-mx2.c
index e364a5ed10f1..77646436c00e 100644
--- a/arch/arm/plat-mxc/dma-mx1-mx2.c
+++ b/arch/arm/plat-mxc/dma-mx1-mx2.c
@@ -693,12 +693,15 @@ int imx_dma_request(int channel, const char *name)
693 local_irq_restore(flags); 693 local_irq_restore(flags);
694 return -EBUSY; 694 return -EBUSY;
695 } 695 }
696 memset(imxdma, 0, sizeof(imxdma));
697 imxdma->name = name;
698 local_irq_restore(flags); /* request_irq() can block */
696 699
697#ifdef CONFIG_ARCH_MX2 700#ifdef CONFIG_ARCH_MX2
698 ret = request_irq(MXC_INT_DMACH0 + channel, dma_irq_handler, 0, "DMA", 701 ret = request_irq(MXC_INT_DMACH0 + channel, dma_irq_handler, 0, "DMA",
699 NULL); 702 NULL);
700 if (ret) { 703 if (ret) {
701 local_irq_restore(flags); 704 imxdma->name = NULL;
702 printk(KERN_CRIT "Can't register IRQ %d for DMA channel %d\n", 705 printk(KERN_CRIT "Can't register IRQ %d for DMA channel %d\n",
703 MXC_INT_DMACH0 + channel, channel); 706 MXC_INT_DMACH0 + channel, channel);
704 return ret; 707 return ret;
@@ -708,13 +711,6 @@ int imx_dma_request(int channel, const char *name)
708 imxdma->watchdog.data = channel; 711 imxdma->watchdog.data = channel;
709#endif 712#endif
710 713
711 imxdma->name = name;
712 imxdma->irq_handler = NULL;
713 imxdma->err_handler = NULL;
714 imxdma->data = NULL;
715 imxdma->sg = NULL;
716
717 local_irq_restore(flags);
718 return ret; 714 return ret;
719} 715}
720EXPORT_SYMBOL(imx_dma_request); 716EXPORT_SYMBOL(imx_dma_request);
@@ -737,10 +733,7 @@ void imx_dma_free(int channel)
737 733
738 local_irq_save(flags); 734 local_irq_save(flags);
739 /* Disable interrupts */ 735 /* Disable interrupts */
740 __raw_writel(__raw_readl(DMA_BASE + DMA_DIMR) | (1 << channel), 736 imx_dma_disable(channel);
741 DMA_BASE + DMA_DIMR);
742 __raw_writel(__raw_readl(DMA_BASE + DMA_CCR(channel)) & ~CCR_CEN,
743 DMA_BASE + DMA_CCR(channel));
744 imxdma->name = NULL; 737 imxdma->name = NULL;
745 738
746#ifdef CONFIG_ARCH_MX2 739#ifdef CONFIG_ARCH_MX2