}
 EXPORT_SYMBOL(imx_dma_disable);
 
+#ifdef CONFIG_ARCH_MX2
 static void imx_dma_watchdog(unsigned long chno)
 {
        struct imx_dma_channel *imxdma = &imx_dma_channels[chno];
        if (imxdma->err_handler)
                imxdma->err_handler(chno, imxdma->data, IMX_DMA_ERR_TIMEOUT);
 }
+#endif
 
 static irqreturn_t dma_err_handler(int irq, void *dev_id)
 {
 {
        struct imx_dma_channel *imxdma = &imx_dma_channels[channel];
        unsigned long flags;
-       int ret;
+       int ret = 0;
 
        /* basic sanity checks */
        if (!name)
        ret = request_irq(MXC_INT_DMACH0 + channel, dma_irq_handler, 0, "DMA",
                        NULL);
        if (ret) {
+               local_irq_restore(flags);
                printk(KERN_CRIT "Can't register IRQ %d for DMA channel %d\n",
                                MXC_INT_DMACH0 + channel, channel);
                return ret;
        imxdma->sg = NULL;
 
        local_irq_restore(flags);
-       return 0;
+       return ret;
 }
 EXPORT_SYMBOL(imx_dma_request);