Skip to content

Commit

Permalink
Blackfin: reject NULL callback in set_dma_callback()
Browse files Browse the repository at this point in the history
It makes no sense to call this function with a NULL callback.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
  • Loading branch information
Mike Frysinger committed Dec 15, 2009
1 parent f69b2d7 commit e34132f
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions arch/blackfin/kernel/bfin_dma_5xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e34132f

Please sign in to comment.