mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-21 16:29:59 +00:00
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>
This commit is contained in:
parent
f69b2d7e97
commit
e34132f40b
1 changed files with 10 additions and 11 deletions
|
@ -138,21 +138,20 @@ EXPORT_SYMBOL(request_dma);
|
||||||
|
|
||||||
int set_dma_callback(unsigned int channel, irq_handler_t callback, void *data)
|
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));
|
!atomic_read(&dma_ch[channel].chan_status));
|
||||||
|
|
||||||
if (callback != NULL) {
|
irq = channel2irq(channel);
|
||||||
int ret;
|
ret = request_irq(irq, callback, 0, dma_ch[channel].device_id, data);
|
||||||
unsigned int irq = channel2irq(channel);
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
|
||||||
ret = request_irq(irq, callback, IRQF_DISABLED,
|
dma_ch[channel].irq = irq;
|
||||||
dma_ch[channel].device_id, data);
|
dma_ch[channel].data = data;
|
||||||
if (ret)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
dma_ch[channel].irq = irq;
|
|
||||||
dma_ch[channel].data = data;
|
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(set_dma_callback);
|
EXPORT_SYMBOL(set_dma_callback);
|
||||||
|
|
Loading…
Reference in a new issue