Merge tag 'iommu-fixes-v5.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-block.git] / drivers / iommu / dma-iommu.c
index 65234e383d6b480ddd1a3fd5aeecd8e788ea77ef..af765c813cc84c5b4cfa5bb0bb1471bc5986c2dc 100644 (file)
@@ -1188,34 +1188,6 @@ static void *iommu_dma_alloc(struct device *dev, size_t size,
        return cpu_addr;
 }
 
-#ifdef CONFIG_DMA_REMAP
-static void *iommu_dma_alloc_noncoherent(struct device *dev, size_t size,
-               dma_addr_t *handle, enum dma_data_direction dir, gfp_t gfp)
-{
-       if (!gfpflags_allow_blocking(gfp)) {
-               struct page *page;
-
-               page = dma_common_alloc_pages(dev, size, handle, dir, gfp);
-               if (!page)
-                       return NULL;
-               return page_address(page);
-       }
-
-       return iommu_dma_alloc_remap(dev, size, handle, gfp | __GFP_ZERO,
-                                    PAGE_KERNEL, 0);
-}
-
-static void iommu_dma_free_noncoherent(struct device *dev, size_t size,
-               void *cpu_addr, dma_addr_t handle, enum dma_data_direction dir)
-{
-       __iommu_dma_unmap(dev, handle, size);
-       __iommu_dma_free(dev, size, cpu_addr);
-}
-#else
-#define iommu_dma_alloc_noncoherent            NULL
-#define iommu_dma_free_noncoherent             NULL
-#endif /* CONFIG_DMA_REMAP */
-
 static int iommu_dma_mmap(struct device *dev, struct vm_area_struct *vma,
                void *cpu_addr, dma_addr_t dma_addr, size_t size,
                unsigned long attrs)
@@ -1286,8 +1258,6 @@ static const struct dma_map_ops iommu_dma_ops = {
        .free                   = iommu_dma_free,
        .alloc_pages            = dma_common_alloc_pages,
        .free_pages             = dma_common_free_pages,
-       .alloc_noncoherent      = iommu_dma_alloc_noncoherent,
-       .free_noncoherent       = iommu_dma_free_noncoherent,
        .mmap                   = iommu_dma_mmap,
        .get_sgtable            = iommu_dma_get_sgtable,
        .map_page               = iommu_dma_map_page,