@@ -1558,7 +1558,7 @@ static int iommu_init_pci(struct amd_iommu *iommu)
return -ENODEV;
/* Prevent binding other PCI device drivers to IOMMU devices */
- iommu->dev->match_driver = false;
+ iommu->dev->match_driver = 0;
pci_read_config_dword(iommu->dev, cap_ptr + MMIO_CAP_HDR_OFFSET,
&iommu->cap);
@@ -322,7 +322,8 @@ void pci_bus_add_device(struct pci_dev *dev)
pci_proc_attach_device(dev);
pci_bridge_d3_update(dev);
- dev->match_driver = true;
+ if (dev->match_driver == 0)
+ dev->match_driver = 1;
retval = device_attach(&dev->dev);
if (retval < 0 && retval != -EPROBE_DEFER) {
dev_warn(&dev->dev, "device attach failed (%d)\n", retval);
@@ -1373,7 +1373,7 @@ static int pci_bus_match(struct device *dev, struct device_driver *drv)
struct pci_driver *pci_drv;
const struct pci_device_id *found_id;
- if (!pci_dev->match_driver)
+ if (pci_dev->match_driver != 1)
return 0;
pci_drv = to_pci_driver(drv);
@@ -2021,7 +2021,7 @@ void pci_device_add(struct pci_dev *dev, struct pci_bus *bus)
pci_set_msi_domain(dev);
/* Notifier could use PCI capabilities */
- dev->match_driver = false;
+ dev->match_driver = 0;
ret = device_add(&dev->dev);
WARN_ON(ret < 0);
}
@@ -344,7 +344,7 @@ struct pci_dev {
unsigned int irq;
struct resource resource[DEVICE_COUNT_RESOURCE]; /* I/O and memory regions + expansion ROMs */
- bool match_driver; /* Skip attaching driver */
+ int match_driver; /* Skip attaching driver */
/* These fields are used by common fixups */
unsigned int transparent:1; /* Subtractive decode PCI bridge */
unsigned int multifunction:1;/* Part of multi-function device */
Change it from false/true to -1/0/1. If it is set from -1, then it will never get change to 1 later. For PCI_TEST, the simulated device does not have realy function support except bus number and BAR setting. Signed-off-by: Yinghai Lu <yinghai@kernel.org> --- drivers/iommu/amd_iommu_init.c | 2 +- drivers/pci/bus.c | 3 ++- drivers/pci/pci-driver.c | 2 +- drivers/pci/probe.c | 2 +- include/linux/pci.h | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-)