diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-02-01 17:09:32 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-02-01 17:09:32 -0500 |
commit | 062f9f024dcdb927cfd35c9ee8a68f59cbb1136f (patch) | |
tree | ef592f702eea3e4333b1e0e2e3db7ce945408261 /drivers/ide/arm | |
parent | 5c05ff68b9a9b40a9be949497e0aa980185565cf (diff) |
ide: use ide_build_sglist() and ide_destroy_dmatable() in non-PCI host drivers
* Make ide_build_sglist() and ide_destroy_dmatable() available also when
CONFIG_BLK_DEV_IDEDMA_PCI=n.
* Use ide_build_sglist() and ide_destroy_dmatable() in {ics,au1xxx-}ide.c
and remove no longer needed {ics,au}ide_build_sglist().
There should be no functionality changes caused by this patch.
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/arm')
-rw-r--r-- | drivers/ide/arm/icside.c | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/drivers/ide/arm/icside.c b/drivers/ide/arm/icside.c index 774b87e1b704..12cbb5d07f61 100644 --- a/drivers/ide/arm/icside.c +++ b/drivers/ide/arm/icside.c | |||
@@ -204,22 +204,6 @@ static void icside_maskproc(ide_drive_t *drive, int mask) | |||
204 | * interfaces use the same IRQ, which should guarantee this. | 204 | * interfaces use the same IRQ, which should guarantee this. |
205 | */ | 205 | */ |
206 | 206 | ||
207 | static void icside_build_sglist(ide_drive_t *drive, struct request *rq) | ||
208 | { | ||
209 | ide_hwif_t *hwif = drive->hwif; | ||
210 | struct scatterlist *sg = hwif->sg_table; | ||
211 | |||
212 | ide_map_sg(drive, rq); | ||
213 | |||
214 | if (rq_data_dir(rq) == READ) | ||
215 | hwif->sg_dma_direction = DMA_FROM_DEVICE; | ||
216 | else | ||
217 | hwif->sg_dma_direction = DMA_TO_DEVICE; | ||
218 | |||
219 | hwif->sg_nents = dma_map_sg(hwif->dev, sg, hwif->sg_nents, | ||
220 | hwif->sg_dma_direction); | ||
221 | } | ||
222 | |||
223 | /* | 207 | /* |
224 | * Configure the IOMD to give the appropriate timings for the transfer | 208 | * Configure the IOMD to give the appropriate timings for the transfer |
225 | * mode being requested. We take the advice of the ATA standards, and | 209 | * mode being requested. We take the advice of the ATA standards, and |
@@ -298,8 +282,7 @@ static int icside_dma_end(ide_drive_t *drive) | |||
298 | disable_dma(ec->dma); | 282 | disable_dma(ec->dma); |
299 | 283 | ||
300 | /* Teardown mappings after DMA has completed. */ | 284 | /* Teardown mappings after DMA has completed. */ |
301 | dma_unmap_sg(hwif->dev, hwif->sg_table, hwif->sg_nents, | 285 | ide_destroy_dmatable(drive); |
302 | hwif->sg_dma_direction); | ||
303 | 286 | ||
304 | return get_dma_residue(ec->dma) != 0; | 287 | return get_dma_residue(ec->dma) != 0; |
305 | } | 288 | } |
@@ -331,7 +314,7 @@ static int icside_dma_setup(ide_drive_t *drive) | |||
331 | */ | 314 | */ |
332 | BUG_ON(dma_channel_active(ec->dma)); | 315 | BUG_ON(dma_channel_active(ec->dma)); |
333 | 316 | ||
334 | icside_build_sglist(drive, rq); | 317 | hwif->sg_nents = ide_build_sglist(drive, rq); |
335 | 318 | ||
336 | /* | 319 | /* |
337 | * Ensure that we have the right interrupt routed. | 320 | * Ensure that we have the right interrupt routed. |