aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-02-01 17:09:31 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-02-01 17:09:31 -0500
commitf6fb786d6dcdd7d730e4fba620b071796f487e1b (patch)
treef1f8368fecee874caf487a95b1cfa2adcdfc0df6
parentfcc1175947510d7d7dc82d5c1b8315cb8fcb96ca (diff)
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>
-rw-r--r--drivers/ide/ide-dma.c8
-rw-r--r--drivers/ide/pci/sgiioc4.c3
-rw-r--r--drivers/ide/ppc/pmac.c16
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)
282 *--table |= cpu_to_le32(0x80000000); 282 *--table |= cpu_to_le32(0x80000000);
283 return count; 283 return count;
284 } 284 }
285
285 printk(KERN_ERR "%s: empty DMA table?\n", drive->name); 286 printk(KERN_ERR "%s: empty DMA table?\n", drive->name);
287
286use_pio_instead: 288use_pio_instead:
287 pci_unmap_sg(hwif->pci_dev, 289 ide_destroy_dmatable(drive);
288 hwif->sg_table, 290
289 hwif->sg_nents,
290 hwif->sg_dma_direction);
291 return 0; /* revert to PIO for this request */ 291 return 0; /* revert to PIO for this request */
292} 292}
293 293
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)
517 } 517 }
518 518
519use_pio_instead: 519use_pio_instead:
520 pci_unmap_sg(hwif->pci_dev, hwif->sg_table, hwif->sg_nents, 520 ide_destroy_dmatable(drive);
521 hwif->sg_dma_direction);
522 521
523 return 0; /* revert to PIO for this request */ 522 return 0; /* revert to PIO for this request */
524} 523}
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)
1535 } 1535 }
1536 1536
1537 printk(KERN_DEBUG "%s: empty DMA table?\n", drive->name); 1537 printk(KERN_DEBUG "%s: empty DMA table?\n", drive->name);
1538 use_pio_instead: 1538
1539 pci_unmap_sg(hwif->pci_dev, 1539use_pio_instead:
1540 hwif->sg_table, 1540 ide_destroy_dmatable(drive);
1541 hwif->sg_nents, 1541
1542 hwif->sg_dma_direction);
1543 return 0; /* revert to PIO for this request */ 1542 return 0; /* revert to PIO for this request */
1544} 1543}
1545 1544
@@ -1548,12 +1547,9 @@ static void
1548pmac_ide_destroy_dmatable (ide_drive_t *drive) 1547pmac_ide_destroy_dmatable (ide_drive_t *drive)
1549{ 1548{
1550 ide_hwif_t *hwif = drive->hwif; 1549 ide_hwif_t *hwif = drive->hwif;
1551 struct pci_dev *dev = HWIF(drive)->pci_dev;
1552 struct scatterlist *sg = hwif->sg_table;
1553 int nents = hwif->sg_nents;
1554 1550
1555 if (nents) { 1551 if (hwif->sg_nents) {
1556 pci_unmap_sg(dev, sg, nents, hwif->sg_dma_direction); 1552 ide_destroy_dmatable(drive);
1557 hwif->sg_nents = 0; 1553 hwif->sg_nents = 0;
1558 } 1554 }
1559} 1555}