iommu: Convert iommu-caps from define to enum
Allow compile-time type-checking. Signed-off-by: Joerg Roedel <jroedel@suse.de>
This commit is contained in:
parent
0f33be009b
commit
1aed074869
@ -948,7 +948,7 @@ phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, dma_addr_t iova)
|
|||||||
EXPORT_SYMBOL_GPL(iommu_iova_to_phys);
|
EXPORT_SYMBOL_GPL(iommu_iova_to_phys);
|
||||||
|
|
||||||
int iommu_domain_has_cap(struct iommu_domain *domain,
|
int iommu_domain_has_cap(struct iommu_domain *domain,
|
||||||
unsigned long cap)
|
enum iommu_cap cap)
|
||||||
{
|
{
|
||||||
if (unlikely(domain->ops->domain_has_cap == NULL))
|
if (unlikely(domain->ops->domain_has_cap == NULL))
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -57,8 +57,11 @@ struct iommu_domain {
|
|||||||
struct iommu_domain_geometry geometry;
|
struct iommu_domain_geometry geometry;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define IOMMU_CAP_CACHE_COHERENCY 0x1
|
enum iommu_cap {
|
||||||
#define IOMMU_CAP_INTR_REMAP 0x2 /* isolates device intrs */
|
IOMMU_CAP_CACHE_COHERENCY, /* IOMMU can enforce cache coherent DMA
|
||||||
|
transactions */
|
||||||
|
IOMMU_CAP_INTR_REMAP, /* IOMMU supports interrupt isolation */
|
||||||
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Following constraints are specifc to FSL_PAMUV1:
|
* Following constraints are specifc to FSL_PAMUV1:
|
||||||
@ -155,7 +158,7 @@ extern size_t iommu_unmap(struct iommu_domain *domain, unsigned long iova,
|
|||||||
size_t size);
|
size_t size);
|
||||||
extern phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, dma_addr_t iova);
|
extern phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, dma_addr_t iova);
|
||||||
extern int iommu_domain_has_cap(struct iommu_domain *domain,
|
extern int iommu_domain_has_cap(struct iommu_domain *domain,
|
||||||
unsigned long cap);
|
enum iommu_cap cap);
|
||||||
extern void iommu_set_fault_handler(struct iommu_domain *domain,
|
extern void iommu_set_fault_handler(struct iommu_domain *domain,
|
||||||
iommu_fault_handler_t handler, void *token);
|
iommu_fault_handler_t handler, void *token);
|
||||||
|
|
||||||
@ -305,7 +308,7 @@ static inline phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, dma_ad
|
|||||||
}
|
}
|
||||||
|
|
||||||
static inline int iommu_domain_has_cap(struct iommu_domain *domain,
|
static inline int iommu_domain_has_cap(struct iommu_domain *domain,
|
||||||
unsigned long cap)
|
enum iommu_cap cap)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user