mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH master 1/3] pci: efi: skip driver model fixup for non-EFI PCI busses
Date: Mon, 15 Nov 2021 10:00:21 +0100	[thread overview]
Message-ID: <20211115090023.4192546-1-a.fatoum@pengutronix.de> (raw)

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>
---
 drivers/pci/pci-efi.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/pci-efi.c b/drivers/pci/pci-efi.c
index e1fe11d07016..846449c4b0e0 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);
-- 
2.30.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


             reply	other threads:[~2021-11-15  9:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-15  9:00 Ahmad Fatoum [this message]
2021-11-15  9:00 ` [PATCH master 2/3] efi: efi-iomem: don't add EFI loader code/data as memory banks Ahmad Fatoum
2021-11-15  9:00 ` [PATCH master 3/3] efi: efi-iomem: fix erroneous use of IS_ENABLED() Ahmad Fatoum
2021-11-15  9:39 ` [PATCH master 1/3] pci: efi: skip driver model fixup for non-EFI PCI busses Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211115090023.4192546-1-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox