From 062f9f024dcdb927cfd35c9ee8a68f59cbb1136f Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Fri, 1 Feb 2008 23:09:32 +0100 Subject: 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 Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/ide/arm/icside.c | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) (limited to 'drivers/ide/arm/icside.c') 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) * interfaces use the same IRQ, which should guarantee this. */ -static void icside_build_sglist(ide_drive_t *drive, struct request *rq) -{ - ide_hwif_t *hwif = drive->hwif; - struct scatterlist *sg = hwif->sg_table; - - ide_map_sg(drive, rq); - - if (rq_data_dir(rq) == READ) - hwif->sg_dma_direction = DMA_FROM_DEVICE; - else - hwif->sg_dma_direction = DMA_TO_DEVICE; - - hwif->sg_nents = dma_map_sg(hwif->dev, sg, hwif->sg_nents, - hwif->sg_dma_direction); -} - /* * Configure the IOMD to give the appropriate timings for the transfer * 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) disable_dma(ec->dma); /* Teardown mappings after DMA has completed. */ - dma_unmap_sg(hwif->dev, hwif->sg_table, hwif->sg_nents, - hwif->sg_dma_direction); + ide_destroy_dmatable(drive); return get_dma_residue(ec->dma) != 0; } @@ -331,7 +314,7 @@ static int icside_dma_setup(ide_drive_t *drive) */ BUG_ON(dma_channel_active(ec->dma)); - icside_build_sglist(drive, rq); + hwif->sg_nents = ide_build_sglist(drive, rq); /* * Ensure that we have the right interrupt routed. -- cgit v1.2.3