[PATCH v1 1/7] PCI: Use child bus's number instead of assuming max+1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In pci_scan_bridge(), a newly allocated child bus's resource is given
the bus number "max+1".  The current enumeration algorithm numbers
each child sequentially, thus the new child's number happens to always
be max+1; see the call to pci_add_new_bus() a few lines earlier.

An upcoming patch will reserve bus numbers, such that the new child
bus's number might no longer be max+1.  Thus when inserting the
child's resources, use the number actually assigned to the child
instead of assuming that it is always max+1.

Signed-off-by: Jason Tang <jason.tang2@xxxxxxx>
---
 drivers/pci/probe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index cefd636..c905db3 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -862,7 +862,7 @@ int pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max, int pass)
 			child = pci_add_new_bus(bus, dev, max+1);
 			if (!child)
 				goto out;
-			pci_bus_insert_busn_res(child, max+1, 0xff);
+			pci_bus_insert_busn_res(child, child->number, 0xff);
 		}
 		max++;
 		buses = (buses & 0xff000000)
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux