Skip to content

Commit

Permalink
PCI: Use pci_is_root_bus() to check for root bus
Browse files Browse the repository at this point in the history
In __pci_bus_size_bridges() we check whether a bus is a root bus by testing
bus->self.  As indicated by commit 79af72d ("PCI: pci_is_root_bus
helper"), bus->self == NULL is not a proper way to check for a root bus.
One issue is that "virtual" buses added for SR-IOV (via virtfn_add_bus())
have bus->self == NULL but are not root buses.

This patch changes it to pci_is_root_bus() to check whether it is a root
bus.

[bhelgaas: changelog]
Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
  • Loading branch information
Wei Yang authored and Bjorn Helgaas committed Sep 25, 2013
1 parent 115e3bc commit 2ba29e2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/pci/setup-bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -1136,7 +1136,7 @@ void __ref __pci_bus_size_bridges(struct pci_bus *bus,
}

/* The root bus? */
if (!bus->self)
if (pci_is_root_bus(bus))
return;

switch (bus->self->class >> 8) {
Expand Down

0 comments on commit 2ba29e2

Please sign in to comment.