aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-dma.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-03-31 14:15:21 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-03-31 14:15:21 -0400
commit8a4a5738ba499083cf4c5668895efe220b1946d3 (patch)
tree78272b711b31f43526d2c665478cc3bdb0b6e393 /drivers/ide/ide-dma.c
parent7526efaafdc835b8d6b22aa1a302e14651373908 (diff)
ide: add ->dma_check method
* Add (an optional) ->dma_check method for checking if DMA can be used for a given command and fail DMA setup in ide_dma_prepare() if necessary. * Convert alim15x3 and trm290 host drivers to use ->dma_check. * Rename ali15x3_dma_setup() to ali_dma_check() while at it. There should be no functional changes caused by this patch. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.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, 4 insertions, 1 deletions
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index cf5897f5533f..c0505e2dfc2e 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -566,9 +566,12 @@ EXPORT_SYMBOL_GPL(ide_allocate_dma_engine);
566 566
567int ide_dma_prepare(ide_drive_t *drive, struct ide_cmd *cmd) 567int ide_dma_prepare(ide_drive_t *drive, struct ide_cmd *cmd)
568{ 568{
569 const struct ide_dma_ops *dma_ops = drive->hwif->dma_ops;
570
569 if ((drive->dev_flags & IDE_DFLAG_USING_DMA) == 0 || 571 if ((drive->dev_flags & IDE_DFLAG_USING_DMA) == 0 ||
572 (dma_ops->dma_check && dma_ops->dma_check(drive, cmd)) ||
570 ide_build_sglist(drive, cmd) == 0 || 573 ide_build_sglist(drive, cmd) == 0 ||
571 drive->hwif->dma_ops->dma_setup(drive, cmd)) 574 dma_ops->dma_setup(drive, cmd))
572 return 1; 575 return 1;
573 return 0; 576 return 0;
574} 577}