aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-dma.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-03-27 07:46:37 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-03-27 07:46:37 -0400
commite6830a86c260d73c6f370aa7ed17ee6c71e5ee05 (patch)
treec2c7d472184da1549852b86eef551609cddcbcbf /drivers/ide/ide-dma.c
parentb109f526cabcd098131e770fd6232282bce147b4 (diff)
ide: call ide_build_sglist() prior to ->dma_setup (v2)
* Re-map sg table if needed in ide_build_sglist(). * Move ide_build_sglist() call from ->dma_setup to its users. * Un-export ide_build_sglist(). v2: * Build fix for CONFIG_BLK_DEV_IDEDMA=n (noticed by Randy Dunlap). There should be no functional changes caused by this patch. Cc: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-dma.c')
-rw-r--r--drivers/ide/ide-dma.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index a878f4734f81..12c11b71402e 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -138,14 +138,15 @@ int ide_build_sglist(ide_drive_t *drive, struct request *rq)
138 hwif->sg_dma_direction = DMA_TO_DEVICE; 138 hwif->sg_dma_direction = DMA_TO_DEVICE;
139 139
140 i = dma_map_sg(hwif->dev, sg, hwif->sg_nents, hwif->sg_dma_direction); 140 i = dma_map_sg(hwif->dev, sg, hwif->sg_nents, hwif->sg_dma_direction);
141 if (i) { 141 if (i == 0)
142 ide_map_sg(drive, rq);
143 else {
142 hwif->orig_sg_nents = hwif->sg_nents; 144 hwif->orig_sg_nents = hwif->sg_nents;
143 hwif->sg_nents = i; 145 hwif->sg_nents = i;
144 } 146 }
145 147
146 return i; 148 return i;
147} 149}
148EXPORT_SYMBOL_GPL(ide_build_sglist);
149 150
150/** 151/**
151 * ide_destroy_dmatable - clean up DMA mapping 152 * ide_destroy_dmatable - clean up DMA mapping