aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iommu/amd_iommu.c
diff options
context:
space:
mode:
authorJoerg Roedel <jroedel@suse.de>2014-09-05 04:48:21 -0400
committerJoerg Roedel <jroedel@suse.de>2014-09-25 09:44:49 -0400
commitab636481863a1039f5ca3643cfb04d4ae0c965cd (patch)
tree8e32644ff4b9e838b67c479c848bd98c7bd49442 /drivers/iommu/amd_iommu.c
parent3c0e0ca0a4e757159d868c4870556515d66b6c97 (diff)
iommu/amd: Convert to iommu_capable() API function
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu/amd_iommu.c')
-rw-r--r--drivers/iommu/amd_iommu.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index ecb0109a5360..7de92768871d 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -3384,20 +3384,20 @@ static phys_addr_t amd_iommu_iova_to_phys(struct iommu_domain *dom,
3384 return paddr; 3384 return paddr;
3385} 3385}
3386 3386
3387static int amd_iommu_domain_has_cap(struct iommu_domain *domain, 3387static bool amd_iommu_capable(enum iommu_cap cap)
3388 unsigned long cap)
3389{ 3388{
3390 switch (cap) { 3389 switch (cap) {
3391 case IOMMU_CAP_CACHE_COHERENCY: 3390 case IOMMU_CAP_CACHE_COHERENCY:
3392 return 1; 3391 return true;
3393 case IOMMU_CAP_INTR_REMAP: 3392 case IOMMU_CAP_INTR_REMAP:
3394 return irq_remapping_enabled; 3393 return (irq_remapping_enabled == 1);
3395 } 3394 }
3396 3395
3397 return 0; 3396 return false;
3398} 3397}
3399 3398
3400static const struct iommu_ops amd_iommu_ops = { 3399static const struct iommu_ops amd_iommu_ops = {
3400 .capable = amd_iommu_capable,
3401 .domain_init = amd_iommu_domain_init, 3401 .domain_init = amd_iommu_domain_init,
3402 .domain_destroy = amd_iommu_domain_destroy, 3402 .domain_destroy = amd_iommu_domain_destroy,
3403 .attach_dev = amd_iommu_attach_device, 3403 .attach_dev = amd_iommu_attach_device,
@@ -3405,7 +3405,6 @@ static const struct iommu_ops amd_iommu_ops = {
3405 .map = amd_iommu_map, 3405 .map = amd_iommu_map,
3406 .unmap = amd_iommu_unmap, 3406 .unmap = amd_iommu_unmap,
3407 .iova_to_phys = amd_iommu_iova_to_phys, 3407 .iova_to_phys = amd_iommu_iova_to_phys,
3408 .domain_has_cap = amd_iommu_domain_has_cap,
3409 .pgsize_bitmap = AMD_IOMMU_PGSIZES, 3408 .pgsize_bitmap = AMD_IOMMU_PGSIZES,
3410}; 3409};
3411 3410