return NULL;
 }
 
-static struct dmar_domain *deferred_attach_domain(struct device *dev)
+static void do_deferred_attach(struct device *dev)
 {
-       if (unlikely(attach_deferred(dev))) {
-               struct iommu_domain *domain;
+       struct iommu_domain *domain;
 
-               dev->archdata.iommu = NULL;
-               domain = iommu_get_domain_for_dev(dev);
-               if (domain)
-                       intel_iommu_attach_device(domain, dev);
-       }
+       dev->archdata.iommu = NULL;
+       domain = iommu_get_domain_for_dev(dev);
+       if (domain)
+               intel_iommu_attach_device(domain, dev);
+}
+
+static struct dmar_domain *deferred_attach_domain(struct device *dev)
+{
+       if (unlikely(attach_deferred(dev)))
+               do_deferred_attach(dev);
 
        return find_domain(dev);
 }