diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-31 14:15:21 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-31 14:15:21 -0400 |
commit | 11998b316173f814698f9037ce9179d634d1f423 (patch) | |
tree | 468bc633384c3bb4cd32754fd853c07fcd54afbc /drivers/ide/sgiioc4.c | |
parent | 8a4a5738ba499083cf4c5668895efe220b1946d3 (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/sgiioc4.c')
-rw-r--r-- | drivers/ide/sgiioc4.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/ide/sgiioc4.c b/drivers/ide/sgiioc4.c index 457a762a1f29..d90e8c5af0a2 100644 --- a/drivers/ide/sgiioc4.c +++ b/drivers/ide/sgiioc4.c | |||
@@ -442,7 +442,7 @@ static int sgiioc4_build_dmatable(ide_drive_t *drive, struct ide_cmd *cmd) | |||
442 | printk(KERN_WARNING | 442 | printk(KERN_WARNING |
443 | "%s: DMA table too small\n", | 443 | "%s: DMA table too small\n", |
444 | drive->name); | 444 | drive->name); |
445 | goto use_pio_instead; | 445 | return 0; |
446 | } else { | 446 | } else { |
447 | u32 bcount = | 447 | u32 bcount = |
448 | 0x10000 - (cur_addr & 0xffff); | 448 | 0x10000 - (cur_addr & 0xffff); |
@@ -477,9 +477,6 @@ static int sgiioc4_build_dmatable(ide_drive_t *drive, struct ide_cmd *cmd) | |||
477 | return count; | 477 | return count; |
478 | } | 478 | } |
479 | 479 | ||
480 | use_pio_instead: | ||
481 | ide_destroy_dmatable(drive); | ||
482 | |||
483 | return 0; /* revert to PIO for this request */ | 480 | return 0; /* revert to PIO for this request */ |
484 | } | 481 | } |
485 | 482 | ||
@@ -488,11 +485,9 @@ static int sgiioc4_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd) | |||
488 | int ddir; | 485 | int ddir; |
489 | u8 write = !!(cmd->tf_flags & IDE_TFLAG_WRITE); | 486 | u8 write = !!(cmd->tf_flags & IDE_TFLAG_WRITE); |
490 | 487 | ||
491 | if (sgiioc4_build_dmatable(drive, cmd) == 0) { | 488 | if (sgiioc4_build_dmatable(drive, cmd) == 0) |
492 | /* try PIO instead of DMA */ | 489 | /* try PIO instead of DMA */ |
493 | ide_map_sg(drive, cmd); | ||
494 | return 1; | 490 | return 1; |
495 | } | ||
496 | 491 | ||
497 | if (write) | 492 | if (write) |
498 | /* Writes TO the IOC4 FROM Main Memory */ | 493 | /* Writes TO the IOC4 FROM Main Memory */ |