powerpc/dma: remove dma_nommu_mmap_coherent
The coherent cache version of this function already is functionally identicall to the default version, and by defining the arch_dma_coherent_to_pfn hook the same is ture for the noncoherent version as well. Signed-off-by: Christoph Hellwig <hch@lst.de> Tested-by: Christian Zigotzky <chzigotzky@xenosoft.de> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:

committed by
Michael Ellerman

parent
18b53a2d47
commit
6666cc17d7
@@ -167,7 +167,6 @@ u64 dma_iommu_get_required_mask(struct device *dev)
|
||||
const struct dma_map_ops dma_iommu_ops = {
|
||||
.alloc = dma_iommu_alloc_coherent,
|
||||
.free = dma_iommu_free_coherent,
|
||||
.mmap = dma_nommu_mmap_coherent,
|
||||
.map_sg = dma_iommu_map_sg,
|
||||
.unmap_sg = dma_iommu_unmap_sg,
|
||||
.dma_supported = dma_iommu_dma_supported,
|
||||
|
@@ -34,7 +34,6 @@ unsigned int ppc_swiotlb_enable;
|
||||
const struct dma_map_ops powerpc_swiotlb_dma_ops = {
|
||||
.alloc = __dma_nommu_alloc_coherent,
|
||||
.free = __dma_nommu_free_coherent,
|
||||
.mmap = dma_nommu_mmap_coherent,
|
||||
.map_sg = dma_direct_map_sg,
|
||||
.unmap_sg = dma_direct_unmap_sg,
|
||||
.dma_supported = swiotlb_dma_supported,
|
||||
|
@@ -114,24 +114,6 @@ void __dma_nommu_free_coherent(struct device *dev, size_t size,
|
||||
}
|
||||
#endif /* !CONFIG_NOT_COHERENT_CACHE */
|
||||
|
||||
int dma_nommu_mmap_coherent(struct device *dev, struct vm_area_struct *vma,
|
||||
void *cpu_addr, dma_addr_t handle, size_t size,
|
||||
unsigned long attrs)
|
||||
{
|
||||
unsigned long pfn;
|
||||
|
||||
#ifdef CONFIG_NOT_COHERENT_CACHE
|
||||
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
|
||||
pfn = __dma_get_coherent_pfn((unsigned long)cpu_addr);
|
||||
#else
|
||||
pfn = page_to_pfn(virt_to_page(cpu_addr));
|
||||
#endif
|
||||
return remap_pfn_range(vma, vma->vm_start,
|
||||
pfn + vma->vm_pgoff,
|
||||
vma->vm_end - vma->vm_start,
|
||||
vma->vm_page_prot);
|
||||
}
|
||||
|
||||
int dma_nommu_map_sg(struct device *dev, struct scatterlist *sgl,
|
||||
int nents, enum dma_data_direction direction,
|
||||
unsigned long attrs)
|
||||
@@ -218,7 +200,6 @@ static inline void dma_nommu_sync_single(struct device *dev,
|
||||
const struct dma_map_ops dma_nommu_ops = {
|
||||
.alloc = __dma_nommu_alloc_coherent,
|
||||
.free = __dma_nommu_free_coherent,
|
||||
.mmap = dma_nommu_mmap_coherent,
|
||||
.map_sg = dma_nommu_map_sg,
|
||||
.unmap_sg = dma_nommu_unmap_sg,
|
||||
.dma_supported = dma_nommu_dma_supported,
|
||||
|
Reference in New Issue
Block a user