diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-31 14:15:19 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-31 14:15:19 -0400 |
commit | 35c9b4daf4c94b30e5cede597d98016ebf31b5ad (patch) | |
tree | 3248b5b3602218537ce0bce420fbde27a07b526b /drivers/ide/ide-dma.c | |
parent | e698ea83a8531a6740dc657329dcf0728392d6ac (diff) |
ide: add ->dma_clear method and remove ->dma_timeout one
All custom ->dma_timeout implementations call the generic one thus it is
possible to have only an optional method for resetting DMA engine instead:
* Add ->dma_clear method and convert hpt366, pdc202xx_old and sl82c105
host drivers to use it.
* Always use ide_dma_timeout() in ide_dma_timeout_retry() and remove
->dma_timeout method.
* Make ide_dma_timeout() 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-dma.c')
-rw-r--r-- | drivers/ide/ide-dma.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c index 3dbf80c15491..dc5d9bc4ced0 100644 --- a/drivers/ide/ide-dma.c +++ b/drivers/ide/ide-dma.c | |||
@@ -460,7 +460,7 @@ void ide_dma_lost_irq(ide_drive_t *drive) | |||
460 | } | 460 | } |
461 | EXPORT_SYMBOL_GPL(ide_dma_lost_irq); | 461 | EXPORT_SYMBOL_GPL(ide_dma_lost_irq); |
462 | 462 | ||
463 | void ide_dma_timeout(ide_drive_t *drive) | 463 | static void ide_dma_timeout(ide_drive_t *drive) |
464 | { | 464 | { |
465 | ide_hwif_t *hwif = drive->hwif; | 465 | ide_hwif_t *hwif = drive->hwif; |
466 | 466 | ||
@@ -473,7 +473,6 @@ void ide_dma_timeout(ide_drive_t *drive) | |||
473 | 473 | ||
474 | hwif->dma_ops->dma_end(drive); | 474 | hwif->dma_ops->dma_end(drive); |
475 | } | 475 | } |
476 | EXPORT_SYMBOL_GPL(ide_dma_timeout); | ||
477 | 476 | ||
478 | /* | 477 | /* |
479 | * un-busy the port etc, and clear any pending DMA status. we want to | 478 | * un-busy the port etc, and clear any pending DMA status. we want to |
@@ -483,6 +482,7 @@ EXPORT_SYMBOL_GPL(ide_dma_timeout); | |||
483 | ide_startstop_t ide_dma_timeout_retry(ide_drive_t *drive, int error) | 482 | ide_startstop_t ide_dma_timeout_retry(ide_drive_t *drive, int error) |
484 | { | 483 | { |
485 | ide_hwif_t *hwif = drive->hwif; | 484 | ide_hwif_t *hwif = drive->hwif; |
485 | const struct ide_dma_ops *dma_ops = hwif->dma_ops; | ||
486 | struct request *rq; | 486 | struct request *rq; |
487 | ide_startstop_t ret = ide_stopped; | 487 | ide_startstop_t ret = ide_stopped; |
488 | 488 | ||
@@ -492,12 +492,14 @@ ide_startstop_t ide_dma_timeout_retry(ide_drive_t *drive, int error) | |||
492 | 492 | ||
493 | if (error < 0) { | 493 | if (error < 0) { |
494 | printk(KERN_WARNING "%s: DMA timeout error\n", drive->name); | 494 | printk(KERN_WARNING "%s: DMA timeout error\n", drive->name); |
495 | (void)hwif->dma_ops->dma_end(drive); | 495 | (void)dma_ops->dma_end(drive); |
496 | ret = ide_error(drive, "dma timeout error", | 496 | ret = ide_error(drive, "dma timeout error", |
497 | hwif->tp_ops->read_status(hwif)); | 497 | hwif->tp_ops->read_status(hwif)); |
498 | } else { | 498 | } else { |
499 | printk(KERN_WARNING "%s: DMA timeout retry\n", drive->name); | 499 | printk(KERN_WARNING "%s: DMA timeout retry\n", drive->name); |
500 | hwif->dma_ops->dma_timeout(drive); | 500 | if (dma_ops->dma_clear) |
501 | dma_ops->dma_clear(drive); | ||
502 | ide_dma_timeout(drive); | ||
501 | } | 503 | } |
502 | 504 | ||
503 | /* | 505 | /* |