aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
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
commit7526efaafdc835b8d6b22aa1a302e14651373908 (patch)
tree7f91c0ef98ca77cb844417b56e5051d9b700db65 /drivers
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')
-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)
184 if (cmd->tf_flags & IDE_TFLAG_WRITE) { 184 if (cmd->tf_flags & IDE_TFLAG_WRITE) {
185#ifdef TRM290_NO_DMA_WRITES 185#ifdef TRM290_NO_DMA_WRITES
186 /* always use PIO for writes */ 186 /* always use PIO for writes */
187 trm290_prepare_drive(drive, 0); /* select PIO xfer */
188 return 1; 187 return 1;
189#endif 188#endif
190 rw = 1; 189 rw = 1;
@@ -195,11 +194,8 @@ static int trm290_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd)
195 if (count == 0) { 194 if (count == 0) {
196 ide_map_sg(drive, cmd); 195 ide_map_sg(drive, cmd);
197 /* try PIO instead of DMA */ 196 /* try PIO instead of DMA */
198 trm290_prepare_drive(drive, 0); /* select PIO xfer */
199 return 1; 197 return 1;
200 } 198 }
201 /* select DMA xfer */
202 trm290_prepare_drive(drive, 1);
203 outl(hwif->dmatable_dma | rw, hwif->dma_base); 199 outl(hwif->dmatable_dma | rw, hwif->dma_base);
204 drive->waiting_for_dma = 1; 200 drive->waiting_for_dma = 1;
205 /* start DMA */ 201 /* start DMA */
@@ -209,6 +205,7 @@ static int trm290_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd)
209 205
210static void trm290_dma_start(ide_drive_t *drive) 206static void trm290_dma_start(ide_drive_t *drive)
211{ 207{
208 trm290_prepare_drive(drive, 1);
212} 209}
213 210
214static int trm290_dma_end(ide_drive_t *drive) 211static int trm290_dma_end(ide_drive_t *drive)
@@ -219,6 +216,8 @@ static int trm290_dma_end(ide_drive_t *drive)
219 216
220 status = inw(drive->hwif->dma_base + 2); 217 status = inw(drive->hwif->dma_base + 2);
221 218
219 trm290_prepare_drive(drive, 0);
220
222 return status != 0x00ff; 221 return status != 0x00ff;
223} 222}
224 223