static int ncv_pccard_attach(device_t dev) { struct ncv_softc *sc = device_get_softc(dev); int error; error = ncv_alloc_resource(dev); if (error) { return(error); } if (ncvprobe(dev) == 0) { ncv_release_resource(dev); return(ENXIO); } error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_CAM | INTR_ENTROPY | INTR_MPSAFE, NULL, ncv_pccard_intr, sc, &sc->ncv_intrhand); if (error) { ncv_release_resource(dev); return(error); } if (ncvattach(dev) == 0) { ncv_release_resource(dev); return(ENXIO); } return(0); }
static int ncv_card_init(DEVPORT_PDEVICE devi) { int unit = DEVPORT_PDEVUNIT(devi); if (NNCV <= unit) return (ENODEV); if (ncvprobe(devi) == 0) return (ENXIO); if (ncvattach(devi) == 0) return (ENXIO); return (0); }
static int ncv_pccard_probe(DEVPORT_PDEVICE dev) { struct ncv_softc *sc = device_get_softc(dev); int error; bzero(sc, sizeof(struct ncv_softc)); error = ncv_alloc_resource(dev); if (error) { return(error); } if (ncvprobe(dev) == 0) { ncv_release_resource(dev); return(ENXIO); } ncv_release_resource(dev); return(0); }