dma-mapping: remove the mapping_error dma_map_ops method
authorChristoph Hellwig <hch@lst.de>
Tue, 4 Dec 2018 22:33:24 +0000 (14:33 -0800)
committerChristoph Hellwig <hch@lst.de>
Thu, 6 Dec 2018 14:56:50 +0000 (06:56 -0800)
No users left except for vmd which just forwards it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/pci/controller/vmd.c
include/linux/dma-mapping.h

index e50b0b5815ffe57c050998f1aa31719566a9dd74..98ce79eac128dd19022b72ed6ef27bf4c57a161c 100644 (file)
@@ -394,11 +394,6 @@ static void vmd_sync_sg_for_device(struct device *dev, struct scatterlist *sg,
        vmd_dma_ops(dev)->sync_sg_for_device(to_vmd_dev(dev), sg, nents, dir);
 }
 
-static int vmd_mapping_error(struct device *dev, dma_addr_t addr)
-{
-       return vmd_dma_ops(dev)->mapping_error(to_vmd_dev(dev), addr);
-}
-
 static int vmd_dma_supported(struct device *dev, u64 mask)
 {
        return vmd_dma_ops(dev)->dma_supported(to_vmd_dev(dev), mask);
@@ -446,7 +441,6 @@ static void vmd_setup_dma_ops(struct vmd_dev *vmd)
        ASSIGN_VMD_DMA_OPS(source, dest, sync_single_for_device);
        ASSIGN_VMD_DMA_OPS(source, dest, sync_sg_for_cpu);
        ASSIGN_VMD_DMA_OPS(source, dest, sync_sg_for_device);
-       ASSIGN_VMD_DMA_OPS(source, dest, mapping_error);
        ASSIGN_VMD_DMA_OPS(source, dest, dma_supported);
        ASSIGN_VMD_DMA_OPS(source, dest, get_required_mask);
        add_dma_domain(domain);
index f89d277cc8ed199fc5b6277e942ddb168d424a46..f4ac26d5294a03d3763e6cd20126a07e5dee8915 100644 (file)
@@ -128,7 +128,6 @@ struct dma_map_ops {
                                   enum dma_data_direction dir);
        void (*cache_sync)(struct device *dev, void *vaddr, size_t size,
                        enum dma_data_direction direction);
-       int (*mapping_error)(struct device *dev, dma_addr_t dma_addr);
        int (*dma_supported)(struct device *dev, u64 mask);
        u64 (*get_required_mask)(struct device *dev);
 };
@@ -580,12 +579,8 @@ static inline void dma_free_coherent(struct device *dev, size_t size,
 
 static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
 {
-       const struct dma_map_ops *ops = get_dma_ops(dev);
-
        debug_dma_mapping_error(dev, dma_addr);
 
-       if (ops->mapping_error)
-               return ops->mapping_error(dev, dma_addr);
        if (dma_addr == DMA_MAPPING_ERROR)
                return 1;
        return 0;