diff options
Diffstat (limited to 'drivers/block/floppy.c')
-rw-r--r-- | drivers/block/floppy.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index 80483aac4cc9..72803a3585ff 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c | |||
@@ -4388,11 +4388,15 @@ static int floppy_grab_irq_and_dma(void) | |||
4388 | if (fd_request_dma()) { | 4388 | if (fd_request_dma()) { |
4389 | DPRINT("Unable to grab DMA%d for the floppy driver\n", | 4389 | DPRINT("Unable to grab DMA%d for the floppy driver\n", |
4390 | FLOPPY_DMA); | 4390 | FLOPPY_DMA); |
4391 | fd_free_irq(); | 4391 | if (can_use_virtual_dma & 2) |
4392 | spin_lock_irqsave(&floppy_usage_lock, flags); | 4392 | use_virtual_dma = can_use_virtual_dma = 1; |
4393 | usage_count--; | 4393 | if (!(can_use_virtual_dma & 1)) { |
4394 | spin_unlock_irqrestore(&floppy_usage_lock, flags); | 4394 | fd_free_irq(); |
4395 | return -1; | 4395 | spin_lock_irqsave(&floppy_usage_lock, flags); |
4396 | usage_count--; | ||
4397 | spin_unlock_irqrestore(&floppy_usage_lock, flags); | ||
4398 | return -1; | ||
4399 | } | ||
4396 | } | 4400 | } |
4397 | 4401 | ||
4398 | for (fdc = 0; fdc < N_FDC; fdc++) { | 4402 | for (fdc = 0; fdc < N_FDC; fdc++) { |