diff options
| author | Abhimanyu Kapur <abhimany@codeaurora.org> | 2015-06-23 15:33:01 -0700 |
|---|---|---|
| committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-22 11:13:09 -0700 |
| commit | 8d4ded3f0234bfb2aa8daeb1ac244ab1c5047ad5 (patch) | |
| tree | 3aac76af619818b28a06631dec97067952d879c8 /include/linux | |
| parent | 057dffa6b91cb8349fa2e10c4ef849a1fe9da105 (diff) | |
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 <abhimany@codeaurora.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/msm_dma_iommu_mapping.h | 37 |
1 files changed, 36 insertions, 1 deletions
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 |
