diff options
author | Mike Frysinger <vapier@gentoo.org> | 2009-11-24 13:36:36 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2009-12-15 00:15:37 -0500 |
commit | e34132f40b12d6066059f623d73da73de5b71e9a (patch) | |
tree | 84739c7862aef64cb333df45a9b9c34b62d20ad4 /arch/blackfin | |
parent | f69b2d7e974e2ce22f4b17ad28c087b1077731bb (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.c | 21 |
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 639dcee5611c..924c00286bab 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); | |||
138 | 138 | ||
139 | int set_dma_callback(unsigned int channel, irq_handler_t callback, void *data) | 139 | int set_dma_callback(unsigned int channel, irq_handler_t callback, void *data) |
140 | { | 140 | { |
141 | BUG_ON(channel >= MAX_DMA_CHANNELS || | 141 | int ret; |
142 | unsigned int irq; | ||
143 | |||
144 | BUG_ON(channel >= MAX_DMA_CHANNELS || !callback || | ||
142 | !atomic_read(&dma_ch[channel].chan_status)); | 145 | !atomic_read(&dma_ch[channel].chan_status)); |
143 | 146 | ||
144 | if (callback != NULL) { | 147 | irq = channel2irq(channel); |
145 | int ret; | 148 | ret = request_irq(irq, callback, 0, dma_ch[channel].device_id, data); |
146 | unsigned int irq = channel2irq(channel); | 149 | if (ret) |
150 | return ret; | ||
147 | 151 | ||
148 | ret = request_irq(irq, callback, IRQF_DISABLED, | 152 | dma_ch[channel].irq = irq; |
149 | dma_ch[channel].device_id, data); | 153 | dma_ch[channel].data = data; |
150 | if (ret) | ||
151 | return ret; | ||
152 | 154 | ||
153 | dma_ch[channel].irq = irq; | ||
154 | dma_ch[channel].data = data; | ||
155 | } | ||
156 | return 0; | 155 | return 0; |
157 | } | 156 | } |
158 | EXPORT_SYMBOL(set_dma_callback); | 157 | EXPORT_SYMBOL(set_dma_callback); |