]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/m68k/kernel/dma.c
mm: bdi: expose the BDI object in sysfs for NFS
[linux-2.6-omap-h63xx.git] / arch / m68k / kernel / dma.c
index fc449f8b204504ac9193a4472c07ca32a6fb7af6..6f8c080dd9f9d24979f23adefb086810b7c2ae65 100644 (file)
@@ -9,13 +9,13 @@
 #include <linux/dma-mapping.h>
 #include <linux/device.h>
 #include <linux/kernel.h>
+#include <linux/scatterlist.h>
 #include <linux/vmalloc.h>
 
 #include <asm/pgalloc.h>
-#include <asm/scatterlist.h>
 
 void *dma_alloc_coherent(struct device *dev, size_t size,
-                        dma_addr_t *handle, int flag)
+                        dma_addr_t *handle, gfp_t flag)
 {
        struct page *page, **map;
        pgprot_t pgprot;
@@ -51,7 +51,7 @@ void *dma_alloc_coherent(struct device *dev, size_t size,
                pgprot_val(pgprot) |= _PAGE_GLOBAL040 | _PAGE_NOCACHE_S;
        else
                pgprot_val(pgprot) |= _PAGE_NOCACHE030;
-       addr = vmap(map, size, flag, pgprot);
+       addr = vmap(map, size, VM_MAP, pgprot);
        kfree(map);
 
        return addr;
@@ -121,7 +121,7 @@ int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
        int i;
 
        for (i = 0; i < nents; sg++, i++) {
-               sg->dma_address = page_to_phys(sg->page) + sg->offset;
+               sg->dma_address = sg_phys(sg);
                dma_sync_single_for_device(dev, sg->dma_address, sg->length, dir);
        }
        return nents;