diff options
-rw-r--r-- | drivers/ide/ide-atapi.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c index c9beda5fca18..e8688c0f8645 100644 --- a/drivers/ide/ide-atapi.c +++ b/drivers/ide/ide-atapi.c | |||
@@ -489,7 +489,7 @@ static int ide_delayed_transfer_pc(ide_drive_t *drive) | |||
489 | 489 | ||
490 | static ide_startstop_t ide_transfer_pc(ide_drive_t *drive) | 490 | static ide_startstop_t ide_transfer_pc(ide_drive_t *drive) |
491 | { | 491 | { |
492 | struct ide_atapi_pc *pc = drive->pc; | 492 | struct ide_atapi_pc *uninitialized_var(pc); |
493 | ide_hwif_t *hwif = drive->hwif; | 493 | ide_hwif_t *hwif = drive->hwif; |
494 | struct request *rq = hwif->hwgroup->rq; | 494 | struct request *rq = hwif->hwgroup->rq; |
495 | ide_expiry_t *expiry; | 495 | ide_expiry_t *expiry; |
@@ -518,6 +518,8 @@ static ide_startstop_t ide_transfer_pc(ide_drive_t *drive) | |||
518 | timeout = rq->timeout; | 518 | timeout = rq->timeout; |
519 | expiry = ide_cd_expiry; | 519 | expiry = ide_cd_expiry; |
520 | } else { | 520 | } else { |
521 | pc = drive->pc; | ||
522 | |||
521 | cmd_len = ATAPI_MIN_CDB_BYTES; | 523 | cmd_len = ATAPI_MIN_CDB_BYTES; |
522 | 524 | ||
523 | /* | 525 | /* |
@@ -550,9 +552,14 @@ static ide_startstop_t ide_transfer_pc(ide_drive_t *drive) | |||
550 | ide_set_handler(drive, ide_pc_intr, timeout, expiry); | 552 | ide_set_handler(drive, ide_pc_intr, timeout, expiry); |
551 | 553 | ||
552 | /* Begin DMA, if necessary */ | 554 | /* Begin DMA, if necessary */ |
553 | if (pc->flags & PC_FLAG_DMA_OK) { | 555 | if (dev_is_idecd(drive)) { |
554 | pc->flags |= PC_FLAG_DMA_IN_PROGRESS; | 556 | if (drive->dma) |
555 | hwif->dma_ops->dma_start(drive); | 557 | hwif->dma_ops->dma_start(drive); |
558 | } else { | ||
559 | if (pc->flags & PC_FLAG_DMA_OK) { | ||
560 | pc->flags |= PC_FLAG_DMA_IN_PROGRESS; | ||
561 | hwif->dma_ops->dma_start(drive); | ||
562 | } | ||
556 | } | 563 | } |
557 | 564 | ||
558 | /* Send the actual packet */ | 565 | /* Send the actual packet */ |