iommu/vt-d: Don't return error when device gets right domain
authorLu Baolu <baolu.lu@linux.intel.com>
Wed, 12 Jun 2019 00:28:45 +0000 (08:28 +0800)
committerJoerg Roedel <jroedel@suse.de>
Wed, 12 Jun 2019 08:36:59 +0000 (10:36 +0200)
If a device gets a right domain in add_device ops, it shouldn't
return error.

Fixes: 942067f1b6b97 ("iommu/vt-d: Identify default domains replaced with private")
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/intel-iommu.c

index 10bdf7ea9564bdac64d39ff8bfee30ebf15fc8bd..60ec58bf6701155c0c92a1d9c1a14dad4363b33c 100644 (file)
@@ -5388,10 +5388,7 @@ static int intel_iommu_add_device(struct device *dev)
                                domain_add_dev_info(si_domain, dev);
                                dev_info(dev,
                                         "Device uses a private identity domain.\n");
-                               return 0;
                        }
-
-                       return -ENODEV;
                }
        } else {
                if (device_def_domain_type(dev) == IOMMU_DOMAIN_DMA) {
@@ -5406,10 +5403,7 @@ static int intel_iommu_add_device(struct device *dev)
 
                                dev_info(dev,
                                         "Device uses a private dma domain.\n");
-                               return 0;
                        }
-
-                       return -ENODEV;
                }
        }