summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2018-12-04 17:33:24 -0500
committerChristoph Hellwig <hch@lst.de>2018-12-06 09:56:50 -0500
commit68c9ac1d1fd51233cfac15484c6153b90aaa4ca4 (patch)
tree12dde8031110277d7d67158a3d61f306a121061b
parenta4abe0ad10654b122caed873d8a7a58989d7cf9b (diff)
dma-mapping: remove the mapping_error dma_map_ops method
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>
-rw-r--r--drivers/pci/controller/vmd.c6
-rw-r--r--include/linux/dma-mapping.h5
2 files changed, 0 insertions, 11 deletions
diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c
index e50b0b5815ff..98ce79eac128 100644
--- a/drivers/pci/controller/vmd.c
+++ b/drivers/pci/controller/vmd.c
@@ -394,11 +394,6 @@ static void vmd_sync_sg_for_device(struct device *dev, struct scatterlist *sg,
394 vmd_dma_ops(dev)->sync_sg_for_device(to_vmd_dev(dev), sg, nents, dir); 394 vmd_dma_ops(dev)->sync_sg_for_device(to_vmd_dev(dev), sg, nents, dir);
395} 395}
396 396
397static int vmd_mapping_error(struct device *dev, dma_addr_t addr)
398{
399 return vmd_dma_ops(dev)->mapping_error(to_vmd_dev(dev), addr);
400}
401
402static int vmd_dma_supported(struct device *dev, u64 mask) 397static int vmd_dma_supported(struct device *dev, u64 mask)
403{ 398{
404 return vmd_dma_ops(dev)->dma_supported(to_vmd_dev(dev), mask); 399 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)
446 ASSIGN_VMD_DMA_OPS(source, dest, sync_single_for_device); 441 ASSIGN_VMD_DMA_OPS(source, dest, sync_single_for_device);
447 ASSIGN_VMD_DMA_OPS(source, dest, sync_sg_for_cpu); 442 ASSIGN_VMD_DMA_OPS(source, dest, sync_sg_for_cpu);
448 ASSIGN_VMD_DMA_OPS(source, dest, sync_sg_for_device); 443 ASSIGN_VMD_DMA_OPS(source, dest, sync_sg_for_device);
449 ASSIGN_VMD_DMA_OPS(source, dest, mapping_error);
450 ASSIGN_VMD_DMA_OPS(source, dest, dma_supported); 444 ASSIGN_VMD_DMA_OPS(source, dest, dma_supported);
451 ASSIGN_VMD_DMA_OPS(source, dest, get_required_mask); 445 ASSIGN_VMD_DMA_OPS(source, dest, get_required_mask);
452 add_dma_domain(domain); 446 add_dma_domain(domain);
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index f89d277cc8ed..f4ac26d5294a 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -128,7 +128,6 @@ struct dma_map_ops {
128 enum dma_data_direction dir); 128 enum dma_data_direction dir);
129 void (*cache_sync)(struct device *dev, void *vaddr, size_t size, 129 void (*cache_sync)(struct device *dev, void *vaddr, size_t size,
130 enum dma_data_direction direction); 130 enum dma_data_direction direction);
131 int (*mapping_error)(struct device *dev, dma_addr_t dma_addr);
132 int (*dma_supported)(struct device *dev, u64 mask); 131 int (*dma_supported)(struct device *dev, u64 mask);
133 u64 (*get_required_mask)(struct device *dev); 132 u64 (*get_required_mask)(struct device *dev);
134}; 133};
@@ -580,12 +579,8 @@ static inline void dma_free_coherent(struct device *dev, size_t size,
580 579
581static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) 580static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
582{ 581{
583 const struct dma_map_ops *ops = get_dma_ops(dev);
584
585 debug_dma_mapping_error(dev, dma_addr); 582 debug_dma_mapping_error(dev, dma_addr);
586 583
587 if (ops->mapping_error)
588 return ops->mapping_error(dev, dma_addr);
589 if (dma_addr == DMA_MAPPING_ERROR) 584 if (dma_addr == DMA_MAPPING_ERROR)
590 return 1; 585 return 1;
591 return 0; 586 return 0;