Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d81ff97a authored by Abhimanyu Kapur's avatar Abhimanyu Kapur
Browse files

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: default avatarAbhimanyu Kapur <abhimany@codeaurora.org>
parent 2bebc639
Loading
Loading
Loading
Loading
+36 −1
Original line number Diff line number Diff line
@@ -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