@@ -166,21 +166,14 @@ static void s390_iommu_detach_device(struct iommu_domain *domain,
166
166
}
167
167
}
168
168
169
- static int s390_iommu_add_device (struct device * dev )
169
+ static struct iommu_device * s390_iommu_probe_device (struct device * dev )
170
170
{
171
- struct iommu_group * group = iommu_group_get_for_dev (dev );
172
171
struct zpci_dev * zdev = to_pci_dev (dev )-> sysdata ;
173
172
174
- if (IS_ERR (group ))
175
- return PTR_ERR (group );
176
-
177
- iommu_group_put (group );
178
- iommu_device_link (& zdev -> iommu_dev , dev );
179
-
180
- return 0 ;
173
+ return & zdev -> iommu_dev ;
181
174
}
182
175
183
- static void s390_iommu_remove_device (struct device * dev )
176
+ static void s390_iommu_release_device (struct device * dev )
184
177
{
185
178
struct zpci_dev * zdev = to_pci_dev (dev )-> sysdata ;
186
179
struct iommu_domain * domain ;
@@ -191,7 +184,7 @@ static void s390_iommu_remove_device(struct device *dev)
191
184
* to vfio-pci and completing the VFIO_SET_IOMMU ioctl (which triggers
192
185
* the attach_dev), removing the device via
193
186
* "echo 1 > /sys/bus/pci/devices/.../remove" won't trigger detach_dev,
194
- * only remove_device will be called via the BUS_NOTIFY_REMOVED_DEVICE
187
+ * only release_device will be called via the BUS_NOTIFY_REMOVED_DEVICE
195
188
* notifier.
196
189
*
197
190
* So let's call detach_dev from here if it hasn't been called before.
@@ -201,9 +194,6 @@ static void s390_iommu_remove_device(struct device *dev)
201
194
if (domain )
202
195
s390_iommu_detach_device (domain , dev );
203
196
}
204
-
205
- iommu_device_unlink (& zdev -> iommu_dev , dev );
206
- iommu_group_remove_device (dev );
207
197
}
208
198
209
199
static int s390_iommu_update_trans (struct s390_domain * s390_domain ,
@@ -373,8 +363,8 @@ static const struct iommu_ops s390_iommu_ops = {
373
363
.map = s390_iommu_map ,
374
364
.unmap = s390_iommu_unmap ,
375
365
.iova_to_phys = s390_iommu_iova_to_phys ,
376
- .add_device = s390_iommu_add_device ,
377
- .remove_device = s390_iommu_remove_device ,
366
+ .probe_device = s390_iommu_probe_device ,
367
+ .release_device = s390_iommu_release_device ,
378
368
.device_group = generic_device_group ,
379
369
.pgsize_bitmap = S390_IOMMU_PGSIZES ,
380
370
};
0 commit comments