Skip to content

Commit

Permalink
[PATCH] IDE: always release DMA engine
Browse files Browse the repository at this point in the history
Release the DMA engine for the custom mapping IDE drivers also (for
example, siimage.c does allocate it in both I/O-mapped and custom-mapped
modes).  Remove useless code from the error path of
ide_allocate_dma_engine().

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Sergei Shtylylov authored and Linus Torvalds committed Oct 3, 2006
1 parent 020e322 commit dc844e0
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions drivers/ide/ide-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -809,15 +809,14 @@ static int ide_release_iomio_dma(ide_hwif_t *hwif)
/*
* Needed for allowing full modular support of ide-driver
*/
int ide_release_dma (ide_hwif_t *hwif)
int ide_release_dma(ide_hwif_t *hwif)
{
ide_release_dma_engine(hwif);

if (hwif->mmio == 2)
return 1;
if (hwif->chipset == ide_etrax100)
return 1;

ide_release_dma_engine(hwif);
return ide_release_iomio_dma(hwif);
else
return ide_release_iomio_dma(hwif);
}

static int ide_allocate_dma_engine(ide_hwif_t *hwif)
Expand All @@ -829,10 +828,9 @@ static int ide_allocate_dma_engine(ide_hwif_t *hwif)
if (hwif->dmatable_cpu)
return 0;

printk(KERN_ERR "%s: -- Error, unable to allocate%s DMA table(s).\n",
hwif->cds->name, !hwif->dmatable_cpu ? " CPU" : "");
printk(KERN_ERR "%s: -- Error, unable to allocate DMA table.\n",
hwif->cds->name);

ide_release_dma_engine(hwif);
return 1;
}

Expand Down

0 comments on commit dc844e0

Please sign in to comment.