iommu/dma: remove most stubs in iommu-dma.h

The direct calls from mapping.c all guarded by use_dma_iommu(), so don't
bother to provide stubs, but instead just expose the prototypes
unconditionally.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Leon Romanovsky <leon@kernel.org>

+8 -100
+8 -100
include/linux/iommu-dma.h
··· 14 14 { 15 15 return dev->dma_iommu; 16 16 } 17 + #else 18 + static inline bool use_dma_iommu(struct device *dev) 19 + { 20 + return false; 21 + } 22 + #endif /* CONFIG_IOMMU_DMA */ 23 + 17 24 dma_addr_t iommu_dma_map_page(struct device *dev, struct page *page, 18 25 unsigned long offset, size_t size, enum dma_data_direction dir, 19 26 unsigned long attrs); ··· 65 58 int nelems, enum dma_data_direction dir); 66 59 void iommu_dma_sync_sg_for_device(struct device *dev, struct scatterlist *sgl, 67 60 int nelems, enum dma_data_direction dir); 68 - #else 69 - static inline bool use_dma_iommu(struct device *dev) 70 - { 71 - return false; 72 - } 73 - static inline dma_addr_t iommu_dma_map_page(struct device *dev, 74 - struct page *page, unsigned long offset, size_t size, 75 - enum dma_data_direction dir, unsigned long attrs) 76 - { 77 - return DMA_MAPPING_ERROR; 78 - } 79 - static inline void iommu_dma_unmap_page(struct device *dev, 80 - dma_addr_t dma_handle, size_t size, enum dma_data_direction dir, 81 - unsigned long attrs) 82 - { 83 - } 84 - static inline int iommu_dma_map_sg(struct device *dev, struct scatterlist *sg, 85 - int nents, enum dma_data_direction dir, unsigned long attrs) 86 - { 87 - return -EINVAL; 88 - } 89 - static inline void iommu_dma_unmap_sg(struct device *dev, 90 - struct scatterlist *sg, int nents, enum dma_data_direction dir, 91 - unsigned long attrs) 92 - { 93 - } 94 - static inline void *iommu_dma_alloc(struct device *dev, size_t size, 95 - dma_addr_t *handle, gfp_t gfp, unsigned long attrs) 96 - { 97 - return NULL; 98 - } 99 - static inline int iommu_dma_mmap(struct device *dev, struct vm_area_struct *vma, 100 - void *cpu_addr, dma_addr_t dma_addr, size_t size, 101 - unsigned long attrs) 102 - { 103 - return -EINVAL; 104 - } 105 - static inline int iommu_dma_get_sgtable(struct device *dev, 106 - struct sg_table *sgt, void *cpu_addr, dma_addr_t dma_addr, 107 - size_t size, unsigned long attrs) 108 - { 109 - return -EINVAL; 110 - } 111 - static inline unsigned long iommu_dma_get_merge_boundary(struct device *dev) 112 - { 113 - return 0; 114 - } 115 - static inline size_t iommu_dma_opt_mapping_size(void) 116 - { 117 - return 0; 118 - } 119 - static inline size_t iommu_dma_max_mapping_size(struct device *dev) 120 - { 121 - return 0; 122 - } 123 - static inline void iommu_dma_free(struct device *dev, size_t size, 124 - void *cpu_addr, dma_addr_t handle, unsigned long attrs) 125 - { 126 - } 127 - static inline dma_addr_t iommu_dma_map_resource(struct device *dev, 128 - phys_addr_t phys, size_t size, enum dma_data_direction dir, 129 - unsigned long attrs) 130 - { 131 - return DMA_MAPPING_ERROR; 132 - } 133 - static inline void iommu_dma_unmap_resource(struct device *dev, 134 - dma_addr_t handle, size_t size, enum dma_data_direction dir, 135 - unsigned long attrs) 136 - { 137 - } 138 - static inline struct sg_table * 139 - iommu_dma_alloc_noncontiguous(struct device *dev, size_t size, 140 - enum dma_data_direction dir, gfp_t gfp, unsigned long attrs) 141 - { 142 - return NULL; 143 - } 144 - static inline void iommu_dma_free_noncontiguous(struct device *dev, size_t size, 145 - struct sg_table *sgt, enum dma_data_direction dir) 146 - { 147 - } 148 - static inline void iommu_dma_sync_single_for_cpu(struct device *dev, 149 - dma_addr_t dma_handle, size_t size, 150 - enum dma_data_direction dir) 151 - { 152 - } 153 - static inline void iommu_dma_sync_single_for_device(struct device *dev, 154 - dma_addr_t dma_handle, size_t size, enum dma_data_direction dir) 155 - { 156 - } 157 - static inline void iommu_dma_sync_sg_for_cpu(struct device *dev, 158 - struct scatterlist *sgl, int nelems, 159 - enum dma_data_direction dir) 160 - { 161 - } 162 - static inline void iommu_dma_sync_sg_for_device(struct device *dev, 163 - struct scatterlist *sgl, int nelems, 164 - enum dma_data_direction dir) 165 - { 166 - } 167 - #endif /* CONFIG_IOMMU_DMA */ 61 + 168 62 #endif /* _LINUX_IOMMU_DMA_H */