public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] pci: bus: only call of_platform_populate() if CONFIG_OF is enabled
@ 2024-07-07 18:38 Bert Karwatzki
  2024-07-07 18:47 ` Lukas Wunner
                   ` (3 more replies)
  0 siblings, 4 replies; 19+ messages in thread
From: Bert Karwatzki @ 2024-07-07 18:38 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Bert Karwatzki, caleb.connolly, bhelgaas, amit.pundir,
	neil.armstrong, Lukas Wunner, linux-kernel, linux-pci

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

^ permalink raw reply related	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2024-07-08 19:17 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-07 18:38 [PATCH v2] pci: bus: only call of_platform_populate() if CONFIG_OF is enabled Bert Karwatzki
2024-07-07 18:47 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox