@@ -3352,17 +3352,19 @@ int iommu_attach_device_pasid(struct iommu_domain *domain,
struct iommu_attach_handle *handle)
{
/* Caller must be a probed driver on dev */
+ const struct iommu_ops *ops = dev_iommu_ops(dev);
struct iommu_group *group = dev->iommu_group;
struct group_device *device;
int ret;
- if (!domain->ops->set_dev_pasid)
+ if (!domain->ops->set_dev_pasid ||
+ !ops->remove_dev_pasid)
return -EOPNOTSUPP;
if (!group)
return -ENODEV;
- if (!dev_has_iommu(dev) || dev_iommu_ops(dev) != domain->owner ||
+ if (!dev_has_iommu(dev) || ops != domain->owner ||
pasid == IOMMU_NO_PASID)
return -EINVAL;