diff options
Diffstat (limited to 'sys/dev/pci/pci_pci.c')
| -rw-r--r-- | sys/dev/pci/pci_pci.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/sys/dev/pci/pci_pci.c b/sys/dev/pci/pci_pci.c index 112b198f0a66..76643bc8f92e 100644 --- a/sys/dev/pci/pci_pci.c +++ b/sys/dev/pci/pci_pci.c @@ -1075,21 +1075,26 @@ pcib_attach_common(device_t dev) } int +pcib_attach_child(device_t dev) +{ + struct pcib_softc *sc; + + sc = device_get_softc(dev); + if (sc->bus.sec == 0) { + /* no secondary bus; we should have fixed this */ + return(0); + } + + sc->child = device_add_child(dev, "pci", -1); + return (bus_generic_attach(dev)); +} + +int pcib_attach(device_t dev) { - struct pcib_softc *sc; - device_t child; pcib_attach_common(dev); - sc = device_get_softc(dev); - if (sc->bus.sec != 0) { - child = device_add_child(dev, "pci", -1); - if (child != NULL) - return(bus_generic_attach(dev)); - } - - /* no secondary bus; we should have fixed this */ - return(0); + return (pcib_attach_child(dev)); } int |
