summaryrefslogtreecommitdiffstats
path: root/arch/blackfin
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-11-24 18:36:36 +0000
committerMike Frysinger <vapier@gentoo.org>2009-12-15 00:15:37 -0500
commite34132f40b12d6066059f623d73da73de5b71e9a (patch)
tree84739c7862aef64cb333df45a9b9c34b62d20ad4 /arch/blackfin
parentf69b2d7e974e2ce22f4b17ad28c087b1077731bb (diff)
Blackfin: reject NULL callback in set_dma_callback()
It makes no sense to call this function with a NULL callback. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'arch/blackfin')
-rw-r--r--arch/blackfin/kernel/bfin_dma_5xx.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/arch/blackfin/kernel/bfin_dma_5xx.c b/arch/blackfin/kernel/bfin_dma_5xx.c
index 639dcee5611..924c00286ba 100644
--- a/arch/blackfin/kernel/bfin_dma_5xx.c
+++ b/arch/blackfin/kernel/bfin_dma_5xx.c
@@ -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);