Skip to content

Commit

Permalink
iommu/amd: Convert to iommu_capable() API function
Browse files Browse the repository at this point in the history
Signed-off-by: Joerg Roedel <jroedel@suse.de>
  • Loading branch information
Joerg Roedel committed Sep 25, 2014
1 parent 3c0e0ca commit ab63648
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions drivers/iommu/amd_iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -3384,28 +3384,27 @@ static phys_addr_t amd_iommu_iova_to_phys(struct iommu_domain *dom,
return paddr;
}

static int amd_iommu_domain_has_cap(struct iommu_domain *domain,
unsigned long cap)
static bool amd_iommu_capable(enum iommu_cap cap)
{
switch (cap) {
case IOMMU_CAP_CACHE_COHERENCY:
return 1;
return true;
case IOMMU_CAP_INTR_REMAP:
return irq_remapping_enabled;
return (irq_remapping_enabled == 1);
}

return 0;
return false;
}

static const struct iommu_ops amd_iommu_ops = {
.capable = amd_iommu_capable,
.domain_init = amd_iommu_domain_init,
.domain_destroy = amd_iommu_domain_destroy,
.attach_dev = amd_iommu_attach_device,
.detach_dev = amd_iommu_detach_device,
.map = amd_iommu_map,
.unmap = amd_iommu_unmap,
.iova_to_phys = amd_iommu_iova_to_phys,
.domain_has_cap = amd_iommu_domain_has_cap,
.pgsize_bitmap = AMD_IOMMU_PGSIZES,
};

Expand Down

0 comments on commit ab63648

Please sign in to comment.