Skip to content

Commit 034d98c

Browse files
committed
iommu/vt-d: Move deferred device attachment into helper function
Move the code that does the deferred device attachment into a separate helper function. Fixes: 1ee0186 ("iommu/vt-d: Refactor find_domain() helper") Cc: [email protected] # v5.5 Reviewed-by: Jerry Snitselaar <[email protected]> Acked-by: Lu Baolu <[email protected]> Signed-off-by: Joerg Roedel <[email protected]>
1 parent 1d46159 commit 034d98c

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

drivers/iommu/intel-iommu.c

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2529,16 +2529,20 @@ struct dmar_domain *find_domain(struct device *dev)
25292529
return NULL;
25302530
}
25312531

2532-
static struct dmar_domain *deferred_attach_domain(struct device *dev)
2532+
static void do_deferred_attach(struct device *dev)
25332533
{
2534-
if (unlikely(attach_deferred(dev))) {
2535-
struct iommu_domain *domain;
2534+
struct iommu_domain *domain;
25362535

2537-
dev->archdata.iommu = NULL;
2538-
domain = iommu_get_domain_for_dev(dev);
2539-
if (domain)
2540-
intel_iommu_attach_device(domain, dev);
2541-
}
2536+
dev->archdata.iommu = NULL;
2537+
domain = iommu_get_domain_for_dev(dev);
2538+
if (domain)
2539+
intel_iommu_attach_device(domain, dev);
2540+
}
2541+
2542+
static struct dmar_domain *deferred_attach_domain(struct device *dev)
2543+
{
2544+
if (unlikely(attach_deferred(dev)))
2545+
do_deferred_attach(dev);
25422546

25432547
return find_domain(dev);
25442548
}

0 commit comments

Comments
 (0)