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

Commit a0475af0 authored by Shiraz Hashim's avatar Shiraz Hashim Committed by Patrick Daly
Browse files

dma-mapping: fix build when !CONFIG_ARM_DMA_USE_IOMMU



Allow compilation when CONFIG_ARM_DMA_USE_IOMMU is not
selected by providing necessary stub functions.

Change-Id: I04e3aa63407064e8d9c9550a5cb0a82ede899f00
Signed-off-by: default avatarShiraz Hashim <shashim@codeaurora.org>
Signed-off-by: default avatarPatrick Daly <pdaly@codeaurora.org>
parent 79d42bd7
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
@@ -24,6 +24,8 @@ struct dma_iommu_mapping {
	struct kref		kref;
};

#ifdef CONFIG_ARM_DMA_USE_IOMMU

struct dma_iommu_mapping *
arm_iommu_create_mapping(struct bus_type *bus, dma_addr_t base, u64 size);

@@ -33,5 +35,29 @@ int arm_iommu_attach_device(struct device *dev,
					struct dma_iommu_mapping *mapping);
void arm_iommu_detach_device(struct device *dev);

#else  /* !CONFIG_ARM_DMA_USE_IOMMU */

static inline struct dma_iommu_mapping *
arm_iommu_create_mapping(struct bus_type *bus, dma_addr_t base, size_t size)
{
	return NULL;
}

static inline void arm_iommu_release_mapping(struct dma_iommu_mapping *mapping)
{
}

static inline int arm_iommu_attach_device(struct device *dev,
			struct dma_iommu_mapping *mapping)
{
	return -ENODEV;
}

static inline void arm_iommu_detach_device(struct device *dev)
{
}

#endif	/* CONFIG_ARM_DMA_USE_IOMMU */

#endif /* __KERNEL__ */
#endif