예제 #1
0
파일: com_isa.c 프로젝트: ryo/netbsd-src
static int
com_isa_detach(device_t self, int flags)
{
	struct com_isa_softc *isc = device_private(self);
	struct com_softc *sc = &isc->sc_com;
	const struct com_regs *cr = &sc->sc_regs;
	int rc;

	if ((rc = com_detach(self, flags)) != 0)
		return rc;

	if (isc->sc_ih != NULL)
		isa_intr_disestablish(isc->sc_ic, isc->sc_ih);

	pmf_device_deregister(self);

	com_cleanup(self, 0);

#ifdef COM_HAYESP
	if (sc->sc_type == COM_TYPE_HAYESP)
		bus_space_unmap(cr->cr_iot, sc->sc_hayespioh, HAYESP_NPORTS);
#endif
	bus_space_unmap(cr->cr_iot, cr->cr_ioh, COM_NPORTS);

	return 0;
}
예제 #2
0
int
com_cardbus_detach(struct device *self, int flags)
{
	struct com_cardbus_softc *csc = (struct com_cardbus_softc *) self;
	struct com_softc *sc = (struct com_softc *) self;
	struct cardbus_softc *psc = (struct cardbus_softc *)self->dv_parent;
	int error;

	if ((error = com_detach(self, flags)) != 0)
		return (error);

	cardbus_intr_disestablish(psc->sc_cc, psc->sc_cf, csc->cc_ih);

	Cardbus_mapreg_unmap(csc->cc_ct, csc->cc_reg, sc->sc_iot, sc->sc_ioh,
	    csc->cc_size);

	return (0);
}