Skip to content

Commit 52dd3ca

Browse files
committed
iommu/pamu: Convert to probe/release_device() call-backs
Convert the PAMU IOMMU driver to use the probe_device() and release_device() call-backs of iommu_ops, so that the iommu core code does the group and sysfs setup. Signed-off-by: Joerg Roedel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent cefa0d5 commit 52dd3ca

File tree

1 file changed

+5
-17
lines changed

1 file changed

+5
-17
lines changed

drivers/iommu/fsl_pamu_domain.c

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,25 +1016,13 @@ static struct iommu_group *fsl_pamu_device_group(struct device *dev)
10161016
return group;
10171017
}
10181018

1019-
static int fsl_pamu_add_device(struct device *dev)
1019+
static struct iommu_device *fsl_pamu_probe_device(struct device *dev)
10201020
{
1021-
struct iommu_group *group;
1022-
1023-
group = iommu_group_get_for_dev(dev);
1024-
if (IS_ERR(group))
1025-
return PTR_ERR(group);
1026-
1027-
iommu_group_put(group);
1028-
1029-
iommu_device_link(&pamu_iommu, dev);
1030-
1031-
return 0;
1021+
return &pamu_iommu;
10321022
}
10331023

1034-
static void fsl_pamu_remove_device(struct device *dev)
1024+
static void fsl_pamu_release_device(struct device *dev)
10351025
{
1036-
iommu_device_unlink(&pamu_iommu, dev);
1037-
iommu_group_remove_device(dev);
10381026
}
10391027

10401028
static const struct iommu_ops fsl_pamu_ops = {
@@ -1048,8 +1036,8 @@ static const struct iommu_ops fsl_pamu_ops = {
10481036
.iova_to_phys = fsl_pamu_iova_to_phys,
10491037
.domain_set_attr = fsl_pamu_set_domain_attr,
10501038
.domain_get_attr = fsl_pamu_get_domain_attr,
1051-
.add_device = fsl_pamu_add_device,
1052-
.remove_device = fsl_pamu_remove_device,
1039+
.probe_device = fsl_pamu_probe_device,
1040+
.release_device = fsl_pamu_release_device,
10531041
.device_group = fsl_pamu_device_group,
10541042
};
10551043

0 commit comments

Comments
 (0)