static int siba_bhndb_attach(device_t dev) { struct siba_bhndb_softc *sc; device_t hostb; int error; sc = device_get_softc(dev); sc->quirks = 0; /* Perform initial attach and enumerate our children. */ if ((error = siba_attach(dev))) return (error); /* Fetch bus-level quirks required by the host bridge core */ if ((hostb = bhnd_bus_find_hostb_device(dev)) != NULL) { sc->quirks |= bhnd_device_quirks(hostb, bridge_devs, sizeof(bridge_devs[0])); } /* Apply attach/resume workarounds before any child drivers attach */ if ((error = siba_bhndb_wars_hwup(sc))) goto failed; /* Delegate remainder to standard bhnd method implementation */ if ((error = bhnd_generic_attach(dev))) goto failed; return (0); failed: siba_detach(dev); return (error); }
static int siba_nexus_attach(device_t dev) { struct siba_nexus_softc *sc; int error; sc = device_get_softc(dev); /* Enumerate the bus. */ if ((error = siba_add_children(dev, NULL))) { device_printf(dev, "error %d enumerating children\n", error); return (error); } return (siba_attach(dev)); }
static int siba_nexus_attach(device_t dev) { int error; /* Perform initial attach and enumerate our children. */ if ((error = siba_attach(dev))) goto failed; /* Delegate remainder to standard bhnd method implementation */ if ((error = bhnd_generic_attach(dev))) goto failed; return (0); failed: device_delete_children(dev); return (error); }