From: Bert Karwatzki Date: Sun, 7 Jul 2024 18:38:28 +0000 (+0200) Subject: PCI/pwrctl: only call of_platform_populate() if CONFIG_OF is enabled X-Git-Tag: io_uring-6.11-20240722~121^2 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=50b040ef3732;p=linux-block.git PCI/pwrctl: only call of_platform_populate() if CONFIG_OF is enabled 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 Closes: https://lore.kernel.org/all/20240702173255.39932-1-superm1@kernel.org/ Reviewed-by: Lukas Wunner Acked-by: Krzysztof WilczyƄski Reported-by: Praveenkumar Patil Acked-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20240707183829.41519-1-spasswolf@web.de Signed-off-by: Bartosz Golaszewski --- diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c index 3e3517567721..8765e2d2aafa 100644 --- a/drivers/pci/bus.c +++ b/drivers/pci/bus.c @@ -356,7 +356,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)