static int stg_isa_attach(device_t dev) { struct stg_softc *sc = device_get_softc(dev); int error; sc->port_rid = 0; sc->irq_rid = 0; error = stg_alloc_resource(dev); if (error) { return(error); } error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_CAM | INTR_ENTROPY, NULL, stg_intr, (void *)sc, &sc->stg_intrhand); if (error) { stg_release_resource(dev); return(error); } if (stg_attach(dev) == 0) { stg_release_resource(dev); return(ENXIO); } return(0); }
static int stg_pci_attach(device_t dev) { struct stg_softc *sc = device_get_softc(dev); int error; sc->port_rid = PCIR_MAPS; sc->irq_rid = 0; error = stg_alloc_resource(dev); if (error) { return(error); } /* XXXX remove INTR_ENTROPY below for MFC */ error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_CAM | INTR_ENTROPY, stg_intr, (void *)sc, &sc->stg_intrhand); if (error) { stg_release_resource(dev); return(error); } if (stg_attach(dev) == 0) { stg_release_resource(dev); return(ENXIO); } return(0); }