]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/iommu/s390-iommu.c
Merge tag 'kvm-4.13-2' of git://git.kernel.org/pub/scm/virt/kvm/kvm
[karo-tx-linux.git] / drivers / iommu / s390-iommu.c
index 179e636a4d916a35e564ed516e7c47af82a1bd83..8788640756a7361ccb656269efd2b8bbb9ac68f7 100644 (file)
@@ -165,20 +165,14 @@ static void s390_iommu_detach_device(struct iommu_domain *domain,
 
 static int s390_iommu_add_device(struct device *dev)
 {
-       struct iommu_group *group;
-       int rc;
+       struct iommu_group *group = iommu_group_get_for_dev(dev);
 
-       group = iommu_group_get(dev);
-       if (!group) {
-               group = iommu_group_alloc();
-               if (IS_ERR(group))
-                       return PTR_ERR(group);
-       }
+       if (IS_ERR(group))
+               return PTR_ERR(group);
 
-       rc = iommu_group_add_device(group, dev);
        iommu_group_put(group);
 
-       return rc;
+       return 0;
 }
 
 static void s390_iommu_remove_device(struct device *dev)
@@ -344,6 +338,7 @@ static struct iommu_ops s390_iommu_ops = {
        .iova_to_phys = s390_iommu_iova_to_phys,
        .add_device = s390_iommu_add_device,
        .remove_device = s390_iommu_remove_device,
+       .device_group = generic_device_group,
        .pgsize_bitmap = S390_IOMMU_PGSIZES,
 };