diff options
author | Joerg Roedel <jroedel@suse.de> | 2017-08-09 16:36:00 +0200 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2017-08-15 13:59:34 +0200 |
commit | 68a17f0be6feb8de1f5e26b93f49791031374c4c (patch) | |
tree | fa1f306ea49d1dd9542575fca68921bd5fae8cae /drivers/iommu/fsl_pamu_domain.c | |
parent | iommu/pamu: WARN when fsl_pamu_probe() is called more than once (diff) | |
download | linux-68a17f0be6feb8de1f5e26b93f49791031374c4c.tar.xz linux-68a17f0be6feb8de1f5e26b93f49791031374c4c.zip |
iommu/pamu: Add support for generic iommu-device
This patch adds a global iommu-handle to the pamu driver and
initializes it at probe time. Also link devices added to the
iommu to this handle.
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 | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu/fsl_pamu_domain.c index da0e1e30ef37..914953b87bf1 100644 --- a/drivers/iommu/fsl_pamu_domain.c +++ b/drivers/iommu/fsl_pamu_domain.c @@ -983,11 +983,14 @@ static int fsl_pamu_add_device(struct device *dev) iommu_group_put(group); + iommu_device_link(&pamu_iommu, dev); + return 0; } static void fsl_pamu_remove_device(struct device *dev) { + iommu_device_unlink(&pamu_iommu, dev); iommu_group_remove_device(dev); } @@ -1047,7 +1050,7 @@ static u32 fsl_pamu_get_windows(struct iommu_domain *domain) return dma_domain->win_cnt; } -static const struct iommu_ops fsl_pamu_ops = { +const struct iommu_ops fsl_pamu_ops = { .capable = fsl_pamu_capable, .domain_alloc = fsl_pamu_domain_alloc, .domain_free = fsl_pamu_domain_free, |