aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/au1xxx-ide.c
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
commit11998b316173f814698f9037ce9179d634d1f423 (patch)
tree468bc633384c3bb4cd32754fd853c07fcd54afbc /drivers/ide/au1xxx-ide.c
parent8a4a5738ba499083cf4c5668895efe220b1946d3 (diff)
ide: move ide_map_sg() call out of ->dma_setup method (take 2)
Move ide_map_sg() call from ->dma_setup implementations and ide_destroy_dmatable() one from *_build_dmatable() to ide_dma_prepare(). There should be no functional changes caused by this patch. Sergei: Removed 'use_pio_instead' labels and replaced 'goto' with 'return 0' -- that required no changes to the follow-up patches... Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/au1xxx-ide.c')
-rw-r--r--drivers/ide/au1xxx-ide.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/ide/au1xxx-ide.c b/drivers/ide/au1xxx-ide.c
index ba2a211758a9..239643806b97 100644
--- a/drivers/ide/au1xxx-ide.c
+++ b/drivers/ide/au1xxx-ide.c
@@ -236,7 +236,7 @@ static int auide_build_dmatable(ide_drive_t *drive, struct ide_cmd *cmd)
236 if (++count >= PRD_ENTRIES) { 236 if (++count >= PRD_ENTRIES) {
237 printk(KERN_WARNING "%s: DMA table too small\n", 237 printk(KERN_WARNING "%s: DMA table too small\n",
238 drive->name); 238 drive->name);
239 goto use_pio_instead; 239 return 0;
240 } 240 }
241 241
242 /* Lets enable intr for the last descriptor only */ 242 /* Lets enable intr for the last descriptor only */
@@ -272,9 +272,6 @@ static int auide_build_dmatable(ide_drive_t *drive, struct ide_cmd *cmd)
272 if (count) 272 if (count)
273 return 1; 273 return 1;
274 274
275 use_pio_instead:
276 ide_destroy_dmatable(drive);
277
278 return 0; /* revert to PIO for this request */ 275 return 0; /* revert to PIO for this request */
279} 276}
280 277
@@ -290,10 +287,8 @@ static void auide_dma_start(ide_drive_t *drive )
290 287
291static int auide_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd) 288static int auide_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd)
292{ 289{
293 if (auide_build_dmatable(drive, cmd) == 0) { 290 if (auide_build_dmatable(drive, cmd) == 0)
294 ide_map_sg(drive, cmd);
295 return 1; 291 return 1;
296 }
297 292
298 drive->waiting_for_dma = 1; 293 drive->waiting_for_dma = 1;
299 return 0; 294 return 0;