Example #1
0
int
bwi_pci_detach(struct device *self, int flags)
{
	struct bwi_pci_softc *psc = (struct bwi_pci_softc *)self;
	struct bwi_softc *sc = &psc->psc_bwi;

	bwi_detach(sc);
	pci_intr_disestablish(psc->psc_pc, psc->psc_ih);

	return (0);
}
int
bwi_pci_detach(device_t self, int flags)
{
	struct bwi_pci_softc *psc = device_private(self);
	struct bwi_softc *sc = &psc->psc_bwi;

	pmf_device_deregister(self);

	bwi_detach(sc);

	if (sc->sc_ih != NULL) {
		pci_intr_disestablish(psc->psc_pc, sc->sc_ih);
		sc->sc_ih = NULL;
	}

	return (0);
}
static int
bwi_pci_detach(device_t dev)
{
	struct bwi_pci_softc *psc = device_get_softc(dev);
	struct bwi_softc *sc = &psc->sc_sc;

	/* check if device was removed */
	sc->sc_invalid = !bus_child_present(dev);

	bwi_detach(sc);

	bus_generic_detach(dev);
	bus_teardown_intr(dev, sc->sc_irq_res, sc->sc_irq_handle);
	bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_irq_res);

	bus_release_resource(dev, SYS_RES_MEMORY, BS_BAR, sc->sc_mem_res);

	return (0);
}