[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220708081418.2691301-1-schnelle@linux.ibm.com>
Date: Fri, 8 Jul 2022 10:14:18 +0200
From: Niklas Schnelle <schnelle@...ux.ibm.com>
To: mjrosato@...ux.ibm.com
Cc: baolu.lu@...ux.intel.com, gerald.schaefer@...ux.ibm.com,
iommu@...ts.linux.dev, joro@...tes.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-s390@...r.kernel.org, robin.murphy@....com,
schnelle@...ux.ibm.com, suravee.suthikulpanit@....com,
vasant.hegde@....com, will@...nel.org
Subject: [PATCH] iommu/s390: fail probe for non-pci device
From: Matthew Rosato <mjrosato@...ux.ibm.com>
s390-iommu only supports pci_bus_type today
Signed-off-by: Matthew Rosato <mjrosato@...ux.ibm.com>
---
drivers/iommu/s390-iommu.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/iommu/s390-iommu.c b/drivers/iommu/s390-iommu.c
index dd957145fb81..762f892b4ec3 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;
}
--
2.34.1
Powered by blists - more mailing lists