From 8d4ded3f0234bfb2aa8daeb1ac244ab1c5047ad5 Mon Sep 17 00:00:00 2001 From: Abhimanyu Kapur Date: Tue, 23 Jun 2015 15:33:01 -0700 Subject: iommu: msm: surround the msm_dma_iommu apis with iommu ifdef Make all msm_dma_iommu apis depend on CONFIG_IOMMU_API as it is only used when we have the linux iommu layer available. Change-Id: I879dc1a9174d498b9b4bc68b2418165f3b2675a3 Signed-off-by: Abhimanyu Kapur --- include/linux/msm_dma_iommu_mapping.h | 37 ++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) (limited to 'include/linux') diff --git a/include/linux/msm_dma_iommu_mapping.h b/include/linux/msm_dma_iommu_mapping.h index a185578915df..a95abc758bf5 100644 --- a/include/linux/msm_dma_iommu_mapping.h +++ b/include/linux/msm_dma_iommu_mapping.h @@ -22,6 +22,7 @@ enum msm_dma_map_attr { MSM_DMA_ATTR_NO_DELAYED_UNMAP = 0x1, }; +#ifdef CONFIG_IOMMU_API /* * This function is not taking a reference to the dma_buf here. It is expected * that clients hold reference to the dma_buf until they are done with mapping @@ -55,7 +56,41 @@ void msm_dma_unmap_sg(struct device *dev, struct scatterlist *sgl, int nents, * Below is private function only to be called by framework (ION) and not by * clients. */ - void msm_dma_buf_freed(void *buffer); +#else /*CONFIG_IOMMU_API*/ + +static inline int msm_dma_map_sg_attrs(struct device *dev, + struct scatterlist *sg, int nents, + enum dma_data_direction dir, struct dma_buf *dma_buf, + int flags) +{ + return -EINVAL; +} + +static inline int msm_dma_map_sg_lazy(struct device *dev, + struct scatterlist *sg, int nents, + enum dma_data_direction dir, + struct dma_buf *dma_buf) +{ + return -EINVAL; +} + +static inline int msm_dma_map_sg(struct device *dev, struct scatterlist *sg, + int nents, enum dma_data_direction dir, + struct dma_buf *dma_buf) +{ + return -EINVAL; +} + +static inline void msm_dma_unmap_sg(struct device *dev, + struct scatterlist *sgl, int nents, + enum dma_data_direction dir, + struct dma_buf *dma_buf) +{ +} + +static inline void msm_dma_buf_freed(void *buffer) {} +#endif /*CONFIG_IOMMU_API*/ + #endif -- cgit v1.2.3