arm64: dma-mapping: Simplify pgprot handling
[cascardo/linux.git] / arch / arm64 / mm / dma-mapping.c
index e5d74cd..0bcc4bc 100644 (file)
@@ -144,6 +144,7 @@ static void *__dma_alloc(struct device *dev, size_t size,
        struct page *page;
        void *ptr, *coherent_ptr;
        bool coherent = is_device_dma_coherent(dev);
+       pgprot_t prot = __get_dma_pgprot(attrs, PAGE_KERNEL, false);
 
        size = PAGE_ALIGN(size);
 
@@ -171,9 +172,7 @@ static void *__dma_alloc(struct device *dev, size_t size,
        /* create a coherent mapping */
        page = virt_to_page(ptr);
        coherent_ptr = dma_common_contiguous_remap(page, size, VM_USERMAP,
-                               __get_dma_pgprot(attrs,
-                                       __pgprot(PROT_NORMAL_NC), false),
-                                       NULL);
+                                                  prot, NULL);
        if (!coherent_ptr)
                goto no_map;