diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-02-02 01:09:31 +0300 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-02-02 01:09:31 +0300 |
commit | f6fb786d6dcdd7d730e4fba620b071796f487e1b (patch) | |
tree | f1f8368fecee874caf487a95b1cfa2adcdfc0df6 /drivers | |
parent | fcc1175947510d7d7dc82d5c1b8315cb8fcb96ca (diff) | |
download | linux-f6fb786d6dcdd7d730e4fba620b071796f487e1b.tar.xz |
ide: use ide_destroy_dmatable() instead of pci_unmap_sg() (take 2)
Use ide_destroy_dmatable() in:
* ide-dma.c::ide_build_dmatable()
* sgiioc4.c::sgiioc4_build_dma_table()
* pmac.c::pmac_ide_{build,destroy}_dmatable()
There should be no functionality changes caused by this patch.
v2:
* pmac.c build fix from Andrew Morton.
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ide/ide-dma.c | 8 | ||||
-rw-r--r-- | drivers/ide/pci/sgiioc4.c | 3 | ||||
-rw-r--r-- | drivers/ide/ppc/pmac.c | 16 |
3 files changed, 11 insertions, 16 deletions
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c index 7d361da8ceb2..1ca1210ec1c0 100644 --- a/drivers/ide/ide-dma.c +++ b/drivers/ide/ide-dma.c @@ -282,12 +282,12 @@ int ide_build_dmatable (ide_drive_t *drive, struct request *rq) *--table |= cpu_to_le32(0x80000000); return count; } + printk(KERN_ERR "%s: empty DMA table?\n", drive->name); + use_pio_instead: - pci_unmap_sg(hwif->pci_dev, - hwif->sg_table, - hwif->sg_nents, - hwif->sg_dma_direction); + ide_destroy_dmatable(drive); + return 0; /* revert to PIO for this request */ } diff --git a/drivers/ide/pci/sgiioc4.c b/drivers/ide/pci/sgiioc4.c index 9e0be7d54980..b60a5e8860cd 100644 --- a/drivers/ide/pci/sgiioc4.c +++ b/drivers/ide/pci/sgiioc4.c @@ -517,8 +517,7 @@ sgiioc4_build_dma_table(ide_drive_t * drive, struct request *rq, int ddir) } use_pio_instead: - pci_unmap_sg(hwif->pci_dev, hwif->sg_table, hwif->sg_nents, - hwif->sg_dma_direction); + ide_destroy_dmatable(drive); return 0; /* revert to PIO for this request */ } diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c index 4afc58fb3674..1d6af8824219 100644 --- a/drivers/ide/ppc/pmac.c +++ b/drivers/ide/ppc/pmac.c @@ -1535,11 +1535,10 @@ pmac_ide_build_dmatable(ide_drive_t *drive, struct request *rq) } printk(KERN_DEBUG "%s: empty DMA table?\n", drive->name); - use_pio_instead: - pci_unmap_sg(hwif->pci_dev, - hwif->sg_table, - hwif->sg_nents, - hwif->sg_dma_direction); + +use_pio_instead: + ide_destroy_dmatable(drive); + return 0; /* revert to PIO for this request */ } @@ -1548,12 +1547,9 @@ static void pmac_ide_destroy_dmatable (ide_drive_t *drive) { ide_hwif_t *hwif = drive->hwif; - struct pci_dev *dev = HWIF(drive)->pci_dev; - struct scatterlist *sg = hwif->sg_table; - int nents = hwif->sg_nents; - if (nents) { - pci_unmap_sg(dev, sg, nents, hwif->sg_dma_direction); + if (hwif->sg_nents) { + ide_destroy_dmatable(drive); hwif->sg_nents = 0; } } |