Skip to content

Commit

Permalink
iommu/vt-d: Convert to iommu_capable() API function
Browse files Browse the repository at this point in the history
Cc: Jiang Liu <[email protected]>
Cc: David Woodhouse <[email protected]>
Signed-off-by: Joerg Roedel <[email protected]>
  • Loading branch information
joergroedel committed Sep 25, 2014
1 parent b7eb678 commit 5d587b8
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions drivers/iommu/intel-iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -4415,17 +4415,14 @@ static phys_addr_t intel_iommu_iova_to_phys(struct iommu_domain *domain,
return phys;
}

static int intel_iommu_domain_has_cap(struct iommu_domain *domain,
unsigned long cap)
static bool intel_iommu_capable(enum iommu_cap cap)
{
struct dmar_domain *dmar_domain = domain->priv;

if (cap == IOMMU_CAP_CACHE_COHERENCY)
return dmar_domain->iommu_snooping;
return domain_update_iommu_snooping(NULL) == 1;
if (cap == IOMMU_CAP_INTR_REMAP)
return irq_remapping_enabled;
return irq_remapping_enabled == 1;

return 0;
return false;
}

static int intel_iommu_add_device(struct device *dev)
Expand Down Expand Up @@ -4464,14 +4461,14 @@ static void intel_iommu_remove_device(struct device *dev)
}

static const struct iommu_ops intel_iommu_ops = {
.capable = intel_iommu_capable,
.domain_init = intel_iommu_domain_init,
.domain_destroy = intel_iommu_domain_destroy,
.attach_dev = intel_iommu_attach_device,
.detach_dev = intel_iommu_detach_device,
.map = intel_iommu_map,
.unmap = intel_iommu_unmap,
.iova_to_phys = intel_iommu_iova_to_phys,
.domain_has_cap = intel_iommu_domain_has_cap,
.add_device = intel_iommu_add_device,
.remove_device = intel_iommu_remove_device,
.pgsize_bitmap = INTEL_IOMMU_PGSIZES,
Expand Down

0 comments on commit 5d587b8

Please sign in to comment.