summaryrefslogtreecommitdiff
path: root/drivers/iommu/sprd-iommu.c
diff options
context:
space:
mode:
authorRobin Murphy <robin.murphy@arm.com>2023-11-21 18:04:03 +0000
committerJoerg Roedel <jroedel@suse.de>2023-11-27 11:03:16 +0100
commite7080665c977ea1aafb8547a9c7bd08b199311d6 (patch)
treeb50a0af095751dbc9e46f1e7c240cac8c9d94e91 /drivers/iommu/sprd-iommu.c
parent17de3f5fdd35676b0e3d41c7c9bf4e3032eb3673 (diff)
iommu: Clean up open-coded ownership checks
Some drivers already implement their own defence against the possibility of being given someone else's device. Since this is now taken care of by the core code (and via a slightly different path from the original fwspec-based idea), let's clean them up. Acked-by: Will Deacon <will@kernel.org> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Reviewed-by: Jerry Snitselaar <jsnitsel@redhat.com> Signed-off-by: Robin Murphy <robin.murphy@arm.com> Link: https://lore.kernel.org/r/58a9879ce3f03562bb061e6714fe6efb554c3907.1700589539.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu/sprd-iommu.c')
-rw-r--r--drivers/iommu/sprd-iommu.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/iommu/sprd-iommu.c b/drivers/iommu/sprd-iommu.c
index 2eb9fb46703b..537359f10997 100644
--- a/drivers/iommu/sprd-iommu.c
+++ b/drivers/iommu/sprd-iommu.c
@@ -385,13 +385,7 @@ static phys_addr_t sprd_iommu_iova_to_phys(struct iommu_domain *domain,
static struct iommu_device *sprd_iommu_probe_device(struct device *dev)
{
- struct iommu_fwspec *fwspec = dev_iommu_fwspec_get(dev);
- struct sprd_iommu_device *sdev;
-
- if (!fwspec || fwspec->ops != &sprd_iommu_ops)
- return ERR_PTR(-ENODEV);
-
- sdev = dev_iommu_priv_get(dev);
+ struct sprd_iommu_device *sdev = dev_iommu_priv_get(dev);
return &sdev->iommu;
}