Merge tag 'powerpc-4.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc...
[cascardo/linux.git] / arch / arc / mm / dma.c
index 73d7e4c..20afc65 100644 (file)
@@ -22,7 +22,7 @@
 
 
 static void *arc_dma_alloc(struct device *dev, size_t size,
-               dma_addr_t *dma_handle, gfp_t gfp, struct dma_attrs *attrs)
+               dma_addr_t *dma_handle, gfp_t gfp, unsigned long attrs)
 {
        unsigned long order = get_order(size);
        struct page *page;
@@ -46,7 +46,7 @@ static void *arc_dma_alloc(struct device *dev, size_t size,
         *   (vs. always going to memory - thus are faster)
         */
        if ((is_isa_arcv2() && ioc_exists) ||
-           dma_get_attr(DMA_ATTR_NON_CONSISTENT, attrs))
+           (attrs & DMA_ATTR_NON_CONSISTENT))
                need_coh = 0;
 
        /*
@@ -90,12 +90,13 @@ static void *arc_dma_alloc(struct device *dev, size_t size,
 }
 
 static void arc_dma_free(struct device *dev, size_t size, void *vaddr,
-               dma_addr_t dma_handle, struct dma_attrs *attrs)
+               dma_addr_t dma_handle, unsigned long attrs)
 {
-       struct page *page = virt_to_page(dma_handle);
+       phys_addr_t paddr = plat_dma_to_phys(dev, dma_handle);
+       struct page *page = virt_to_page(paddr);
        int is_non_coh = 1;
 
-       is_non_coh = dma_get_attr(DMA_ATTR_NON_CONSISTENT, attrs) ||
+       is_non_coh = (attrs & DMA_ATTR_NON_CONSISTENT) ||
                        (is_isa_arcv2() && ioc_exists);
 
        if (PageHighMem(page) || !is_non_coh)
@@ -129,7 +130,7 @@ static void _dma_cache_sync(phys_addr_t paddr, size_t size,
 
 static dma_addr_t arc_dma_map_page(struct device *dev, struct page *page,
                unsigned long offset, size_t size, enum dma_data_direction dir,
-               struct dma_attrs *attrs)
+               unsigned long attrs)
 {
        phys_addr_t paddr = page_to_phys(page) + offset;
        _dma_cache_sync(paddr, size, dir);
@@ -137,7 +138,7 @@ static dma_addr_t arc_dma_map_page(struct device *dev, struct page *page,
 }
 
 static int arc_dma_map_sg(struct device *dev, struct scatterlist *sg,
-          int nents, enum dma_data_direction dir, struct dma_attrs *attrs)
+          int nents, enum dma_data_direction dir, unsigned long attrs)
 {
        struct scatterlist *s;
        int i;