summaryrefslogtreecommitdiff
path: root/drivers/ide
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-03-31 20:15:21 +0200
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-03-31 20:15:21 +0200
commit7526efaafdc835b8d6b22aa1a302e14651373908 (patch)
tree7f91c0ef98ca77cb844417b56e5051d9b700db65 /drivers/ide
parenta6d67ffa7dfe9515d8f2051a76b14c82b748475a (diff)
trm290: use custom ->dma_{start,end} to handle trm290_prepare_drive()
Use custom ->dma_{start,end} methods to handle trm290_prepare_drive() there instead of in ->dma_setup method. There should be no functional changes caused by this patch (DMA support is disabled currently in trm290.c). Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide')
-rw-r--r--drivers/ide/trm290.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/ide/trm290.c b/drivers/ide/trm290.c
index 8dd3d8226870..b91bb709af40 100644
--- a/drivers/ide/trm290.c
+++ b/drivers/ide/trm290.c
@@ -184,7 +184,6 @@ static int trm290_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd)
if (cmd->tf_flags & IDE_TFLAG_WRITE) {
#ifdef TRM290_NO_DMA_WRITES
/* always use PIO for writes */
- trm290_prepare_drive(drive, 0); /* select PIO xfer */
return 1;
#endif
rw = 1;
@@ -195,11 +194,8 @@ static int trm290_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd)
if (count == 0) {
ide_map_sg(drive, cmd);
/* try PIO instead of DMA */
- trm290_prepare_drive(drive, 0); /* select PIO xfer */
return 1;
}
- /* select DMA xfer */
- trm290_prepare_drive(drive, 1);
outl(hwif->dmatable_dma | rw, hwif->dma_base);
drive->waiting_for_dma = 1;
/* start DMA */
@@ -209,6 +205,7 @@ static int trm290_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd)
static void trm290_dma_start(ide_drive_t *drive)
{
+ trm290_prepare_drive(drive, 1);
}
static int trm290_dma_end(ide_drive_t *drive)
@@ -219,6 +216,8 @@ static int trm290_dma_end(ide_drive_t *drive)
status = inw(drive->hwif->dma_base + 2);
+ trm290_prepare_drive(drive, 0);
+
return status != 0x00ff;
}