]> Pileus Git - ~andy/linux/blobdiff - drivers/ide/ide-dma.c
ide: call ide_build_sglist() prior to ->dma_setup (v2)
[~andy/linux] / drivers / ide / ide-dma.c
index a878f4734f8129139efc995bd8c65337f6dad0fc..12c11b71402e9527fa0d0d0a4a14ccdc20fc20fb 100644 (file)
@@ -138,14 +138,15 @@ int ide_build_sglist(ide_drive_t *drive, struct request *rq)
                hwif->sg_dma_direction = DMA_TO_DEVICE;
 
        i = dma_map_sg(hwif->dev, sg, hwif->sg_nents, hwif->sg_dma_direction);
-       if (i) {
+       if (i == 0)
+               ide_map_sg(drive, rq);
+       else {
                hwif->orig_sg_nents = hwif->sg_nents;
                hwif->sg_nents = i;
        }
 
        return i;
 }
-EXPORT_SYMBOL_GPL(ide_build_sglist);
 
 /**
  *     ide_destroy_dmatable    -       clean up DMA mapping