diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2011-10-15 12:02:14 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2011-10-15 12:02:14 -0400 |
commit | 3f2288ffcb02c6fff7187116175da909f4c7cef6 (patch) | |
tree | 4db4b52a4c78d25156336798b31258280f4f646b | |
parent | b725dcb7912bf52d0083f352875d28000bcb45fd (diff) | |
download | seabios-3f2288ffcb02c6fff7187116175da909f4c7cef6.tar.gz |
Move pciinit device init code together.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r-- | src/pciinit.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/pciinit.c b/src/pciinit.c index 3398387..d927ef2 100644 --- a/src/pciinit.c +++ b/src/pciinit.c @@ -230,17 +230,19 @@ static void pci_bios_init_device(struct pci_device *pci) pci_init_device(pci_device_tbl, pci, NULL); } -static void pci_bios_init_device_in_bus(int bus) +static void pci_bios_init_devices(void) { struct pci_device *pci; foreachpci(pci) { - u8 pci_bus = pci_bdf_to_bus(pci->bdf); - if (pci_bus < bus) - continue; - if (pci_bus > bus) + if (pci_bdf_to_bus(pci->bdf) != 0) + // Only init devices on host bus. break; pci_bios_init_device(pci); } + + foreachpci(pci) { + pci_init_device(pci_isa_bridge_tbl, pci, NULL); + } } @@ -604,12 +606,7 @@ pci_setup(void) dprintf(1, "=== PCI new allocation pass #2 ===\n"); pci_bios_map_devices(busses); - pci_bios_init_device_in_bus(0 /* host bus */); - - struct pci_device *pci; - foreachpci(pci) { - pci_init_device(pci_isa_bridge_tbl, pci, NULL); - } + pci_bios_init_devices(); free(busses); } |