linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI: Fix device node for virtual bus
@ 2014-11-12  2:42 Gavin Shan
  2014-11-12  2:55 ` Bjorn Helgaas
  2014-11-20 23:11 ` Bjorn Helgaas
  0 siblings, 2 replies; 8+ messages in thread
From: Gavin Shan @ 2014-11-12  2:42 UTC (permalink / raw)
  To: linux-pci; +Cc: bhelgaas, Gavin Shan

pci_set_bus_of_node() sets virtual PCI bus's device node to PHB's
device node wrongly. The patch fixes the issue.

Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
---
 drivers/pci/of.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/of.c b/drivers/pci/of.c
index f092993..7b2256b 100644
--- a/drivers/pci/of.c
+++ b/drivers/pci/of.c
@@ -31,9 +31,9 @@ void pci_release_of_node(struct pci_dev *dev)
 
 void pci_set_bus_of_node(struct pci_bus *bus)
 {
-	if (bus->self == NULL)
+	if (pci_is_root_bus(bus))
 		bus->dev.of_node = pcibios_get_phb_of_node(bus);
-	else
+	else if (bus->self)
 		bus->dev.of_node = of_node_get(bus->self->dev.of_node);
 }
 
-- 
1.8.3.2


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

end of thread, other threads:[~2014-11-20 23:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-12  2:42 [PATCH] PCI: Fix device node for virtual bus Gavin Shan
2014-11-12  2:55 ` Bjorn Helgaas
2014-11-12  3:11   ` Gavin Shan
2014-11-12  4:08     ` Bjorn Helgaas
2014-11-12  5:24       ` Gavin Shan
2014-11-12 19:02         ` Bjorn Helgaas
2014-11-13  0:45           ` Gavin Shan
2014-11-20 23:11 ` Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).