Blackfin: reject NULL callback in set_dma_callback()
authorMike Frysinger <vapier@gentoo.org>
Tue, 24 Nov 2009 18:36:36 +0000 (18:36 +0000)
committerMike Frysinger <vapier@gentoo.org>
Tue, 15 Dec 2009 05:15:37 +0000 (00:15 -0500)
It makes no sense to call this function with a NULL callback.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
arch/blackfin/kernel/bfin_dma_5xx.c

index 639dcee5611c48b6d042b3ec8f7dde0af43d6668..924c00286bab84d87611bc8896df9ba85806fd09 100644 (file)
@@ -138,21 +138,20 @@ EXPORT_SYMBOL(request_dma);
 
 int set_dma_callback(unsigned int channel, irq_handler_t callback, void *data)
 {
-       BUG_ON(channel >= MAX_DMA_CHANNELS ||
+       int ret;
+       unsigned int irq;
+
+       BUG_ON(channel >= MAX_DMA_CHANNELS || !callback ||
                        !atomic_read(&dma_ch[channel].chan_status));
 
-       if (callback != NULL) {
-               int ret;
-               unsigned int irq = channel2irq(channel);
+       irq = channel2irq(channel);
+       ret = request_irq(irq, callback, 0, dma_ch[channel].device_id, data);
+       if (ret)
+               return ret;
 
-               ret = request_irq(irq, callback, IRQF_DISABLED,
-                       dma_ch[channel].device_id, data);
-               if (ret)
-                       return ret;
+       dma_ch[channel].irq = irq;
+       dma_ch[channel].data = data;
 
-               dma_ch[channel].irq = irq;
-               dma_ch[channel].data = data;
-       }
        return 0;
 }
 EXPORT_SYMBOL(set_dma_callback);