Skip to content

Commit

Permalink
Blackfin arch: set_dma_callback: do not store .irq
Browse files Browse the repository at this point in the history
set_dma_callback: do not store .irq if request_irq() failed so we dont
turn around and attempt to free_irq() it later on in free_dma()

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
  • Loading branch information
Mike Frysinger authored and Bryan Wu committed Jan 7, 2009
1 parent 9b01140 commit 8f1cc23
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions arch/blackfin/kernel/bfin_dma_5xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,18 +157,16 @@ int set_dma_callback(unsigned int channel, irq_handler_t callback, void *data)
&& channel < MAX_DMA_CHANNELS));

if (callback != NULL) {
int ret_val;
dma_ch[channel].irq = channel2irq(channel);
dma_ch[channel].data = data;
int ret;
unsigned int irq = channel2irq(channel);

ret_val =
request_irq(dma_ch[channel].irq, callback, IRQF_DISABLED,
dma_ch[channel].device_id, data);
if (ret_val) {
printk(KERN_NOTICE
"Request irq in DMA engine failed.\n");
return -EPERM;
}
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;
}
return 0;
}
Expand Down

0 comments on commit 8f1cc23

Please sign in to comment.