diff options
author | Anton Vorontsov <avorontsov@ru.mvista.com> | 2009-02-19 18:20:41 +0300 |
---|---|---|
committer | Kim Phillips <kim.phillips@freescale.com> | 2009-02-23 15:51:10 -0600 |
commit | cc2a8c7751ddbae3116660064f446888538b93e9 (patch) | |
tree | ba61cef3f050c33d99558d99da8e56e773413e0b /drivers | |
parent | 741a1ea97335c88747a2de6677b92458d6ada00b (diff) | |
download | u-boot-cc2a8c7751ddbae3116660064f446888538b93e9.zip u-boot-cc2a8c7751ddbae3116660064f446888538b93e9.tar.gz u-boot-cc2a8c7751ddbae3116660064f446888538b93e9.tar.bz2 |
PCI: Add pci_last_busno() helper
This is just a handy routine that reports last PCI busno: we walk
down all the hoses and return last hose's last_busno.
Will be used by PCI/PCIe initialization code.
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/pci/pci.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index fffca49..d6d2d6e 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -165,6 +165,19 @@ struct pci_controller *pci_bus_to_hose (int bus) return NULL; } +int pci_last_busno(void) +{ + struct pci_controller *hose = hose_head; + + if (!hose) + return -1; + + while (hose->next) + hose = hose->next; + + return hose->last_busno; +} + #ifndef CONFIG_IXP425 pci_dev_t pci_find_devices(struct pci_device_id *ids, int index) { |