aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iommu
diff options
context:
space:
mode:
authorJoerg Roedel <jroedel@suse.de>2015-07-21 12:25:11 -0400
committerJoerg Roedel <jroedel@suse.de>2015-08-12 10:23:35 -0400
commit76f45fe35c7a54e6fe5539660db2c8cfb23a2972 (patch)
tree306c36884a928e19a88fd03554005650fc0a03ba /drivers/iommu
parentb608ac3b6d54c38d6cf0eb91547f0f960633eb2d (diff)
iommu/vt-d: Simplify domain_remove_dev_info()
Just call domain_remove_one_dev_info() for all devices in the domain instead of reimplementing the functionality. Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu')
-rw-r--r--drivers/iommu/intel-iommu.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index d241353226c5..c674aa12ef31 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -2253,25 +2253,9 @@ static inline void unlink_domain_info(struct device_domain_info *info)
2253static void domain_remove_dev_info(struct dmar_domain *domain) 2253static void domain_remove_dev_info(struct dmar_domain *domain)
2254{ 2254{
2255 struct device_domain_info *info, *tmp; 2255 struct device_domain_info *info, *tmp;
2256 unsigned long flags;
2257
2258 spin_lock_irqsave(&device_domain_lock, flags);
2259 list_for_each_entry_safe(info, tmp, &domain->devices, link) {
2260 unlink_domain_info(info);
2261 spin_unlock_irqrestore(&device_domain_lock, flags);
2262
2263 iommu_disable_dev_iotlb(info);
2264 iommu_detach_dev(info->iommu, info->bus, info->devfn);
2265
2266 if (domain_type_is_vm(domain)) {
2267 iommu_detach_dependent_devices(info->iommu, info->dev);
2268 domain_detach_iommu(domain, info->iommu);
2269 }
2270 2256
2271 free_devinfo_mem(info); 2257 list_for_each_entry_safe(info, tmp, &domain->devices, link)
2272 spin_lock_irqsave(&device_domain_lock, flags); 2258 domain_remove_one_dev_info(domain, info->dev);
2273 }
2274 spin_unlock_irqrestore(&device_domain_lock, flags);
2275} 2259}
2276 2260
2277/* 2261/*