aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iommu
diff options
context:
space:
mode:
authorMatthew Rosato <mjrosato@linux.ibm.com>2022-08-15 17:20:04 +0100
committerJoerg Roedel <jroedel@suse.de>2022-09-07 14:25:02 +0200
commit927a5fdd949a03a244c1f5b3e6103aaadd547542 (patch)
tree76f7572c7cfaf2d8cedb14b01ce384db3e06ec86 /drivers/iommu
parentiommu/amd: Handle race between registration and device probe (diff)
downloadlinux-dev-927a5fdd949a03a244c1f5b3e6103aaadd547542.tar.xz
linux-dev-927a5fdd949a03a244c1f5b3e6103aaadd547542.zip
iommu/s390: Fail probe for non-PCI devices
s390-iommu only supports pci_bus_type today. Tested-by: Niklas Schnelle <schnelle@linux.ibm.com> Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com> Signed-off-by: Robin Murphy <robin.murphy@arm.com> Link: https://lore.kernel.org/r/8cb71ea1b24bd2622c1937bd9cfffe73b126eb56.1660572783.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu')
-rw-r--r--drivers/iommu/s390-iommu.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/iommu/s390-iommu.c b/drivers/iommu/s390-iommu.c
index cd0ee89d63e0..ac4dab6d79e2 100644
--- a/drivers/iommu/s390-iommu.c
+++ b/drivers/iommu/s390-iommu.c
@@ -185,7 +185,12 @@ static void s390_iommu_detach_device(struct iommu_domain *domain,
static struct iommu_device *s390_iommu_probe_device(struct device *dev)
{
- struct zpci_dev *zdev = to_zpci_dev(dev);
+ struct zpci_dev *zdev;
+
+ if (!dev_is_pci(dev))
+ return ERR_PTR(-ENODEV);
+
+ zdev = to_zpci_dev(dev);
return &zdev->iommu_dev;
}