]> err.no Git - linux-2.6/commitdiff
fvr32: fixup dma-mapping for new sg layout
authorJens Axboe <jens.axboe@oracle.com>
Tue, 23 Oct 2007 10:54:14 +0000 (12:54 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Tue, 23 Oct 2007 10:54:14 +0000 (12:54 +0200)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
include/asm-avr32/dma-mapping.h

index 81e342636ac4cb3d93fc612b9018f5895f57e2c7..a7131630c057ae3c3b1b00c92ec712a26fa1eaf4 100644 (file)
@@ -217,8 +217,8 @@ dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
        for (i = 0; i < nents; i++) {
                char *virt;
 
-               sg[i].dma_address = page_to_bus(sg[i].page) + sg[i].offset;
-               virt = page_address(sg[i].page) + sg[i].offset;
+               sg[i].dma_address = page_to_bus(sg_page(&sg[i])) + sg[i].offset;
+               virt = sg_virt(&sg[i]);
                dma_cache_sync(dev, virt, sg[i].length, direction);
        }
 
@@ -327,8 +327,7 @@ dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg,
        int i;
 
        for (i = 0; i < nents; i++) {
-               dma_cache_sync(dev, page_address(sg[i].page) + sg[i].offset,
-                              sg[i].length, direction);
+               dma_cache_sync(dev, sg_virt(&sg[i]), sg[i].length, direction);
        }
 }