arm64: dma-mapping: fix build when !CONFIG_ARM64_DMA_USE_IOMMU
When CONFIG_ARM64_DMA_USE_IOMMU is not selected, drivers that make use of the ARM DMA IOMMU mapping APIs currently don't link. First instinct might be to add a dependency on CONFIG_ARM64_DMA_USE_IOMMU to those drivers, but they might not actually want to do that because they might have other ways of getting DMA-able memory. Allow compilation when CONFIG_ARM64_DMA_USE_IOMMU is not selected by providing necessary stub functions. Change-Id: I172e00a0748c70676b8ff7555e217a1e6122e3e6 Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
This commit is contained in:
parent
95d01c7209
commit
6e0817546a
1 changed files with 27 additions and 0 deletions
|
@ -22,6 +22,8 @@ struct dma_iommu_mapping {
|
|||
struct kref kref;
|
||||
};
|
||||
|
||||
#ifdef CONFIG_ARM64_DMA_USE_IOMMU
|
||||
|
||||
struct dma_iommu_mapping *
|
||||
arm_iommu_create_mapping(struct bus_type *bus, dma_addr_t base, size_t size,
|
||||
int order);
|
||||
|
@ -32,5 +34,30 @@ int arm_iommu_attach_device(struct device *dev,
|
|||
struct dma_iommu_mapping *mapping);
|
||||
void arm_iommu_detach_device(struct device *dev);
|
||||
|
||||
#else /* !CONFIG_ARM64_DMA_USE_IOMMU */
|
||||
|
||||
static inline struct dma_iommu_mapping *
|
||||
arm_iommu_create_mapping(struct bus_type *bus, dma_addr_t base, size_t size,
|
||||
int order)
|
||||
{
|
||||
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_ARM64_DMA_USE_IOMMU */
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue