aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-dma.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/ide-dma.c')
-rw-r--r--drivers/ide/ide-dma.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index b430898bbcd6..cf5897f5533f 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -128,7 +128,7 @@ int ide_dma_good_drive(ide_drive_t *drive)
128 * operate in a portable fashion. 128 * operate in a portable fashion.
129 */ 129 */
130 130
131int ide_build_sglist(ide_drive_t *drive, struct ide_cmd *cmd) 131static int ide_build_sglist(ide_drive_t *drive, struct ide_cmd *cmd)
132{ 132{
133 ide_hwif_t *hwif = drive->hwif; 133 ide_hwif_t *hwif = drive->hwif;
134 struct scatterlist *sg = hwif->sg_table; 134 struct scatterlist *sg = hwif->sg_table;
@@ -563,3 +563,12 @@ int ide_allocate_dma_engine(ide_hwif_t *hwif)
563 return 0; 563 return 0;
564} 564}
565EXPORT_SYMBOL_GPL(ide_allocate_dma_engine); 565EXPORT_SYMBOL_GPL(ide_allocate_dma_engine);
566
567int ide_dma_prepare(ide_drive_t *drive, struct ide_cmd *cmd)
568{
569 if ((drive->dev_flags & IDE_DFLAG_USING_DMA) == 0 ||
570 ide_build_sglist(drive, cmd) == 0 ||
571 drive->hwif->dma_ops->dma_setup(drive, cmd))
572 return 1;
573 return 0;
574}