diff mbox series

[3/3] PCI: of: Add some debug printks to track problems with of_node setup

Message ID c4f873203f8811b8657fc4a01cd1410977e68b84.1628151761.git.mchehab+huawei@kernel.org (mailing list archive)
State New
Delegated to: Rob Herring
Headers show
Series Fix handling of multi-level OF nodes | expand

Commit Message

Mauro Carvalho Chehab Aug. 5, 2021, 8:29 a.m. UTC
In order to be able to identify why some of_nodes are not created,
we need to add some debug prints.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
 drivers/pci/of.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/pci/of.c b/drivers/pci/of.c
index b6fa3bd46ae6..7b8c2b87eb25 100644
--- a/drivers/pci/of.c
+++ b/drivers/pci/of.c
@@ -18,6 +18,9 @@ 
 #ifdef CONFIG_PCI
 void pci_set_of_node(struct pci_dev *dev)
 {
+	dev_dbg(&dev->dev, "%s: of_node: %pOF\n",
+		__func__, dev->bus->dev.of_node);
+
 	if (!dev->bus->dev.of_node)
 		return;
 	dev->dev.of_node = of_pci_find_child_device(dev->bus->dev.of_node,
@@ -41,12 +44,16 @@  void pci_set_bus_of_node(struct pci_bus *bus)
 		node = pcibios_get_phb_of_node(bus);
 	} else {
 		node = of_node_get(bus->self->dev.of_node);
-		if (!node)
+		if (!node) {
 			node = of_node_get(bus->self->dev.parent->of_node);
+			dev_dbg(&bus->dev, "%s: use of_node of the parent",
+				__func__);
+		}
 		if (node && of_property_read_bool(node, "external-facing"))
 			bus->self->external_facing = true;
 	}
 
+	dev_dbg(&bus->dev, "%s: of_node: %pOF\n", __func__, node);
 	bus->dev.of_node = node;
 
 	if (bus->dev.of_node)