diff options
author | Joerg Roedel <jroedel@suse.de> | 2020-04-29 15:36:56 +0200 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2020-05-05 14:36:13 +0200 |
commit | 52dd3ca4176f7f87452ee4b9d9a6d2e57ac4ccb7 (patch) | |
tree | d383fb6f8531f76ff1d4fb42744f5570b52b78dc /drivers/iommu/fsl_pamu_domain.c | |
parent | cefa0d55da3753e969764fb4b161052a1cb4ddfb (diff) | |
download | linux-stable-52dd3ca4176f7f87452ee4b9d9a6d2e57ac4ccb7.tar.gz linux-stable-52dd3ca4176f7f87452ee4b9d9a6d2e57ac4ccb7.tar.bz2 linux-stable-52dd3ca4176f7f87452ee4b9d9a6d2e57ac4ccb7.zip |
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 <jroedel@suse.de>
Link: https://lore.kernel.org/r/20200429133712.31431-19-joro@8bytes.org
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu/fsl_pamu_domain.c')
-rw-r--r-- | drivers/iommu/fsl_pamu_domain.c | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu/fsl_pamu_domain.c index 06828e2698d5..928d37771ece 100644 --- a/drivers/iommu/fsl_pamu_domain.c +++ b/drivers/iommu/fsl_pamu_domain.c @@ -1016,25 +1016,13 @@ static struct iommu_group *fsl_pamu_device_group(struct device *dev) return group; } -static int fsl_pamu_add_device(struct device *dev) +static struct iommu_device *fsl_pamu_probe_device(struct device *dev) { - struct iommu_group *group; - - group = iommu_group_get_for_dev(dev); - if (IS_ERR(group)) - return PTR_ERR(group); - - iommu_group_put(group); - - iommu_device_link(&pamu_iommu, dev); - - return 0; + return &pamu_iommu; } -static void fsl_pamu_remove_device(struct device *dev) +static void fsl_pamu_release_device(struct device *dev) { - iommu_device_unlink(&pamu_iommu, dev); - iommu_group_remove_device(dev); } static const struct iommu_ops fsl_pamu_ops = { @@ -1048,8 +1036,8 @@ static const struct iommu_ops fsl_pamu_ops = { .iova_to_phys = fsl_pamu_iova_to_phys, .domain_set_attr = fsl_pamu_set_domain_attr, .domain_get_attr = fsl_pamu_get_domain_attr, - .add_device = fsl_pamu_add_device, - .remove_device = fsl_pamu_remove_device, + .probe_device = fsl_pamu_probe_device, + .release_device = fsl_pamu_release_device, .device_group = fsl_pamu_device_group, }; |