All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bert Karwatzki <spasswolf@web.de>
To: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Cc: Bert Karwatzki <spasswolf@web.de>,
	caleb.connolly@linaro.org, bhelgaas@google.com,
	amit.pundir@linaro.org, neil.armstrong@linaro.org,
	Lukas Wunner <lukas@wunner.de>,
	linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org
Subject: [PATCH v2] pci: bus: only call of_platform_populate() if CONFIG_OF is enabled
Date: Sun,  7 Jul 2024 20:38:28 +0200	[thread overview]
Message-ID: <20240707183829.41519-1-spasswolf@web.de> (raw)
In-Reply-To: ZoqYz-MWD06GmKPJ@wunner.de

If of_platform_populate() is called when CONFIG_OF is not defined this
leads to spurious error messages of the following type:
 pci 0000:00:01.1: failed to populate child OF nodes (-19)
 pci 0000:00:02.1: failed to populate child OF nodes (-19)

Fixes: 8fb18619d910 ("PCI/pwrctl: Create platform devices for child OF nodes of the port node")

Signed-off-by: Bert Karwatzki <spasswolf@web.de>
---
 drivers/pci/bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c
index e4735428814d..3bab78cc68f7 100644
--- a/drivers/pci/bus.c
+++ b/drivers/pci/bus.c
@@ -350,7 +350,7 @@ void pci_bus_add_device(struct pci_dev *dev)

 	pci_dev_assign_added(dev, true);

-	if (pci_is_bridge(dev)) {
+	if (IS_ENABLED(CONFIG_OF) && pci_is_bridge(dev)) {
 		retval = of_platform_populate(dev->dev.of_node, NULL, NULL,
 					      &dev->dev);
 		if (retval)
--
2.45.2

Just in case this is needed.

Bert Karwatzki

             reply	other threads:[~2024-07-07 18:38 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-07 18:38 Bert Karwatzki [this message]
2024-07-07 18:47 ` [PATCH v2] pci: bus: only call of_platform_populate() if CONFIG_OF is enabled Lukas Wunner
2024-07-08  0:37   ` Krzysztof Wilczyński
2024-07-08  6:52     ` Bartosz Golaszewski
2024-07-08  8:33       ` Krzysztof Wilczyński
2024-07-08 15:29         ` Mario Limonciello
2024-07-08 15:34           ` Bartosz Golaszewski
2024-07-08 15:44             ` Manivannan Sadhasivam
2024-07-08 15:46               ` Mario Limonciello
2024-07-08 15:49                 ` Bartosz Golaszewski
2024-07-08 15:53                   ` Mario Limonciello
2024-07-08 15:58                     ` Bartosz Golaszewski
2024-07-08 16:01                       ` Mario Limonciello
2024-07-08 15:58                     ` Manivannan Sadhasivam
2024-07-08  7:22 ` Manivannan Sadhasivam
2024-07-08  9:54 ` Bartosz Golaszewski
2024-07-08  9:55   ` Bartosz Golaszewski
2024-07-08 19:13 ` Bjorn Helgaas
2024-07-08 19:16   ` Bartosz Golaszewski

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=20240707183829.41519-1-spasswolf@web.de \
    --to=spasswolf@web.de \
    --cc=amit.pundir@linaro.org \
    --cc=bartosz.golaszewski@linaro.org \
    --cc=bhelgaas@google.com \
    --cc=caleb.connolly@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=neil.armstrong@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.