diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2021-11-15 10:00:21 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2021-11-15 10:38:51 +0100 |
commit | 462f3ca86565811116c2bbadc958192bc277dc89 (patch) | |
tree | e7bbe2b42750e2ecc115450614cbab6daa4c8d32 | |
parent | 724512bbac14b869f165cdbef46bfdca5303a51a (diff) | |
download | barebox-462f3ca86565811116c2bbadc958192bc277dc89.tar.gz barebox-462f3ca86565811116c2bbadc958192bc277dc89.tar.xz |
pci: efi: skip driver model fixup for non-EFI PCI busses
The EFI driver registers a PCI fixup to associate PCI devices probed via
EFI with their parent. Restrict the fixup to EFI PCI busses only, so
other PCI drivers can be used in the same build.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20211115090023.4192546-1-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | drivers/pci/pci-efi.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/pci/pci-efi.c b/drivers/pci/pci-efi.c index e1fe11d070..846449c4b0 100644 --- a/drivers/pci/pci-efi.c +++ b/drivers/pci/pci-efi.c @@ -209,15 +209,22 @@ static u8 *acpi_parse_resource(u8 *next, struct resource *out) return next; } +static struct efi_driver efi_pci_driver; + /* EFI already enumerated the bus for us, match our new pci devices with the efi * handles */ static void efi_pci_fixup_dev_parent(struct pci_dev *dev) { - struct efi_pci_priv *priv = host_to_efi_pci(dev->bus->host); + struct efi_pci_priv *priv; struct pci_child *child; struct pci_child_id id; + if (dev->dev.driver != &efi_pci_driver.driver) + return; + + priv = host_to_efi_pci(dev->bus->host); + id.segmentno = priv->protocol->segmentno; id.busno = dev->bus->number; id.devno = PCI_SLOT(dev->devfn); |