/* If the driver core informs the DMA layer if a driver grabs a device we don't need to preallocate the protection domains anymore. For now we have to.  */
static void prealloc_protection_domains(void)
/* If the driver core informs the DMA layer if a driver grabs a device we don't need to preallocate the protection domains anymore. For now we have to.  */
static void prealloc_protection_domains(void)
{
	struct pci_dev *dev = NULL;
	struct dma_ops_domain *dma_dom;
	u16 devid;
	while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
		if (!check_device(&dev->dev))
			continue;
		if (domain_for_device(&dev->dev))
			continue;
		devid = get_device_id(&dev->dev);
		dma_dom = dma_ops_domain_alloc();
		if (!dma_dom)
			continue;
		init_unity_mappings_for_device(dma_dom, devid);
		dma_dom->target_dev = devid;
		attach_device(&dev->dev, &dma_dom->domain);
		list_add_tail(&dma_dom->list, &iommu_pd_list);
	}
}