diff options
author | Mike Frysinger <vapier.adi@gmail.com> | 2009-01-07 10:14:39 -0500 |
---|---|---|
committer | Bryan Wu <cooloney@kernel.org> | 2009-01-07 10:14:39 -0500 |
commit | 8f1cc233881cd5335327ef84baa6ba1c83b379b4 (patch) | |
tree | e663b60299606914dd9b4418e63c38ffca492f64 /arch/blackfin/kernel | |
parent | 9b011407d653b92191aa4993222523039d44af52 (diff) |
Blackfin arch: set_dma_callback: do not store .irq
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>
Diffstat (limited to 'arch/blackfin/kernel')
-rw-r--r-- | arch/blackfin/kernel/bfin_dma_5xx.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/arch/blackfin/kernel/bfin_dma_5xx.c b/arch/blackfin/kernel/bfin_dma_5xx.c index bdebab41419f..ed7d2859a626 100644 --- a/arch/blackfin/kernel/bfin_dma_5xx.c +++ b/arch/blackfin/kernel/bfin_dma_5xx.c | |||
@@ -157,18 +157,16 @@ int set_dma_callback(unsigned int channel, irq_handler_t callback, void *data) | |||
157 | && channel < MAX_DMA_CHANNELS)); | 157 | && channel < MAX_DMA_CHANNELS)); |
158 | 158 | ||
159 | if (callback != NULL) { | 159 | if (callback != NULL) { |
160 | int ret_val; | 160 | int ret; |
161 | dma_ch[channel].irq = channel2irq(channel); | 161 | unsigned int irq = channel2irq(channel); |
162 | dma_ch[channel].data = data; | ||
163 | 162 | ||
164 | ret_val = | 163 | ret = request_irq(irq, callback, IRQF_DISABLED, |
165 | request_irq(dma_ch[channel].irq, callback, IRQF_DISABLED, | 164 | dma_ch[channel].device_id, data); |
166 | dma_ch[channel].device_id, data); | 165 | if (ret) |
167 | if (ret_val) { | 166 | return ret; |
168 | printk(KERN_NOTICE | 167 | |
169 | "Request irq in DMA engine failed.\n"); | 168 | dma_ch[channel].irq = irq; |
170 | return -EPERM; | 169 | dma_ch[channel].data = data; |
171 | } | ||
172 | } | 170 | } |
173 | return 0; | 171 | return 0; |
174 | } | 172 | } |