diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-31 14:15:20 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-31 14:15:20 -0400 |
commit | 5ae5412d9a23b05ab08461b202bad21ad8f6b66d (patch) | |
tree | 25d86e7cf0b57e15efa74e5150c2a654fc9339c9 /drivers/ide/ide-atapi.c | |
parent | 4453011f959a5f5c6c7a33aea54fe17f5e43a867 (diff) |
ide: add ide_dma_prepare() helper
* Add ide_dma_prepare() helper.
* Convert ide_issue_pc() and do_rw_taskfile() to use it.
* Make ide_build_sglist() static.
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-atapi.c')
-rw-r--r-- | drivers/ide/ide-atapi.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c index 1481f71f8173..89d2339bdef3 100644 --- a/drivers/ide/ide-atapi.c +++ b/drivers/ide/ide-atapi.c | |||
@@ -638,7 +638,6 @@ ide_startstop_t ide_issue_pc(ide_drive_t *drive, struct ide_cmd *cmd) | |||
638 | { | 638 | { |
639 | struct ide_atapi_pc *pc; | 639 | struct ide_atapi_pc *pc; |
640 | ide_hwif_t *hwif = drive->hwif; | 640 | ide_hwif_t *hwif = drive->hwif; |
641 | const struct ide_dma_ops *dma_ops = hwif->dma_ops; | ||
642 | ide_expiry_t *expiry = NULL; | 641 | ide_expiry_t *expiry = NULL; |
643 | struct request *rq = hwif->rq; | 642 | struct request *rq = hwif->rq; |
644 | unsigned int timeout; | 643 | unsigned int timeout; |
@@ -652,12 +651,8 @@ ide_startstop_t ide_issue_pc(ide_drive_t *drive, struct ide_cmd *cmd) | |||
652 | expiry = ide_cd_expiry; | 651 | expiry = ide_cd_expiry; |
653 | timeout = ATAPI_WAIT_PC; | 652 | timeout = ATAPI_WAIT_PC; |
654 | 653 | ||
655 | if (drive->dma) { | 654 | if (drive->dma) |
656 | if (ide_build_sglist(drive, cmd)) | 655 | drive->dma = !ide_dma_prepare(drive, cmd); |
657 | drive->dma = !dma_ops->dma_setup(drive, cmd); | ||
658 | else | ||
659 | drive->dma = 0; | ||
660 | } | ||
661 | } else { | 656 | } else { |
662 | pc = drive->pc; | 657 | pc = drive->pc; |
663 | 658 | ||
@@ -675,13 +670,8 @@ ide_startstop_t ide_issue_pc(ide_drive_t *drive, struct ide_cmd *cmd) | |||
675 | ide_dma_off(drive); | 670 | ide_dma_off(drive); |
676 | } | 671 | } |
677 | 672 | ||
678 | if ((pc->flags & PC_FLAG_DMA_OK) && | 673 | if (pc->flags & PC_FLAG_DMA_OK) |
679 | (drive->dev_flags & IDE_DFLAG_USING_DMA)) { | 674 | drive->dma = !ide_dma_prepare(drive, cmd); |
680 | if (ide_build_sglist(drive, cmd)) | ||
681 | drive->dma = !dma_ops->dma_setup(drive, cmd); | ||
682 | else | ||
683 | drive->dma = 0; | ||
684 | } | ||
685 | 675 | ||
686 | if (!drive->dma) | 676 | if (!drive->dma) |
687 | pc->flags &= ~PC_FLAG_DMA_OK; | 677 | pc->flags &= ~PC_FLAG_DMA_OK; |