static int fe_pccard_attach(device_t dev) { struct fe_softc *sc; const struct fe_pccard_product *pp; int error; /* Prepare for the device probe process. */ sc = device_get_softc(dev); sc->sc_unit = device_get_unit(dev); pp = (const struct fe_pccard_product *) pccard_product_lookup(dev, (const struct pccard_product *)fe_pccard_products, sizeof(fe_pccard_products[0]), NULL); if (pp == NULL) return (ENXIO); if (pp->mpp_flags & MPP_MBH10302) error = fe_probe_mbh(dev, pp); else error = fe_probe_tdk(dev, pp); if (error != 0) { fe_release_resource(dev); return (error); } error = fe_alloc_irq(dev, 0); if (error != 0) { fe_release_resource(dev); return (error); } return (fe_attach(dev)); }
static int fe_isa_attach(device_t dev) { struct fe_softc *sc = device_get_softc(dev); if (sc->port_used) fe_alloc_port(dev, sc->port_used); fe_alloc_irq(dev, 0); return fe_attach(dev); }
static int fe_isa_attach(device_t dev) { struct fe_softc *sc = device_get_softc(dev); int error = 0; /* * Note: these routines aren't expected to fail since we also call * them in the probe routine. But coverity complains, so we'll honor * that complaint since the intention here was never to ignore them.. */ if (sc->port_used) { error = fe98_alloc_port(dev, sc->type); if (error != 0) return (error); } error = fe_alloc_irq(dev, 0); if (error != 0) return (error); return fe_attach(dev); }