Commit 50b040ef authored by Bert Karwatzki's avatar Bert Karwatzki Committed by Bartosz Golaszewski

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: 8fb18619 ("PCI/pwrctl: Create platform devices for child OF nodes of the port node")
Signed-off-by: default avatarBert Karwatzki <spasswolf@web.de>
Closes: https://lore.kernel.org/all/20240702173255.39932-1-superm1@kernel.org/Reviewed-by: default avatarLukas Wunner <lukas@wunner.de>
Acked-by: default avatarKrzysztof Wilczyński <kw@linux.com>
Reported-by: default avatarPraveenkumar Patil <PraveenKumar.Patil@amd.com>
Acked-by: default avatarManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Link: https://lore.kernel.org/r/20240707183829.41519-1-spasswolf@web.deSigned-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
parent eba6d0f8
...@@ -356,7 +356,7 @@ void pci_bus_add_device(struct pci_dev *dev) ...@@ -356,7 +356,7 @@ void pci_bus_add_device(struct pci_dev *dev)
pci_dev_assign_added(dev, true); 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, retval = of_platform_populate(dev->dev.of_node, NULL, NULL,
&dev->dev); &dev->dev);
if (retval) if (retval)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment