diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-27 07:46:37 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-27 07:46:37 -0400 |
commit | e6830a86c260d73c6f370aa7ed17ee6c71e5ee05 (patch) | |
tree | c2c7d472184da1549852b86eef551609cddcbcbf /drivers/ide/sgiioc4.c | |
parent | b109f526cabcd098131e770fd6232282bce147b4 (diff) |
ide: call ide_build_sglist() prior to ->dma_setup (v2)
* Re-map sg table if needed in ide_build_sglist().
* Move ide_build_sglist() call from ->dma_setup to its users.
* Un-export ide_build_sglist().
v2:
* Build fix for CONFIG_BLK_DEV_IDEDMA=n (noticed by Randy Dunlap).
There should be no functional changes caused by this patch.
Cc: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/sgiioc4.c')
-rw-r--r-- | drivers/ide/sgiioc4.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/ide/sgiioc4.c b/drivers/ide/sgiioc4.c index 1cffe70f385d..ab9433a7ad1f 100644 --- a/drivers/ide/sgiioc4.c +++ b/drivers/ide/sgiioc4.c | |||
@@ -429,15 +429,9 @@ sgiioc4_build_dma_table(ide_drive_t * drive, struct request *rq, int ddir) | |||
429 | { | 429 | { |
430 | ide_hwif_t *hwif = drive->hwif; | 430 | ide_hwif_t *hwif = drive->hwif; |
431 | unsigned int *table = hwif->dmatable_cpu; | 431 | unsigned int *table = hwif->dmatable_cpu; |
432 | unsigned int count = 0, i = 1; | 432 | unsigned int count = 0, i = hwif->sg_nents; |
433 | struct scatterlist *sg; | 433 | struct scatterlist *sg = hwif->sg_table; |
434 | 434 | ||
435 | hwif->sg_nents = i = ide_build_sglist(drive, rq); | ||
436 | |||
437 | if (!i) | ||
438 | return 0; /* sglist of length Zero */ | ||
439 | |||
440 | sg = hwif->sg_table; | ||
441 | while (i && sg_dma_len(sg)) { | 435 | while (i && sg_dma_len(sg)) { |
442 | dma_addr_t cur_addr; | 436 | dma_addr_t cur_addr; |
443 | int cur_len; | 437 | int cur_len; |