Skip to content

Commit

Permalink
iommu/exynos: Use generic group callback
Browse files Browse the repository at this point in the history
Since iommu_group_get_for_dev() already tries iommu_group_get() and will
not call ops->device_group if the group is already non-NULL, the check
in get_device_iommu_group() is always redundant and it reduces to a
duplicate of the generic version; let's just use that one instead.

Signed-off-by: Robin Murphy <[email protected]>
Tested-by: Marek Szyprowski <[email protected]>
Signed-off-by: Joerg Roedel <[email protected]>
  • Loading branch information
rmurphy-arm authored and joergroedel committed Feb 13, 2018
1 parent 7928b2c commit 6d7cf02
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions drivers/iommu/exynos-iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1238,17 +1238,6 @@ static phys_addr_t exynos_iommu_iova_to_phys(struct iommu_domain *iommu_domain,
return phys;
}

static struct iommu_group *get_device_iommu_group(struct device *dev)
{
struct iommu_group *group;

group = iommu_group_get(dev);
if (!group)
group = iommu_group_alloc();

return group;
}

static int exynos_iommu_add_device(struct device *dev)
{
struct exynos_iommu_owner *owner = dev->archdata.iommu;
Expand Down Expand Up @@ -1344,7 +1333,7 @@ static const struct iommu_ops exynos_iommu_ops = {
.unmap = exynos_iommu_unmap,
.map_sg = default_iommu_map_sg,
.iova_to_phys = exynos_iommu_iova_to_phys,
.device_group = get_device_iommu_group,
.device_group = generic_device_group,
.add_device = exynos_iommu_add_device,
.remove_device = exynos_iommu_remove_device,
.pgsize_bitmap = SECT_SIZE | LPAGE_SIZE | SPAGE_SIZE,
Expand Down

0 comments on commit 6d7cf02

Please sign in to comment.