Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/usb/controller/dwc_otg_fdt.c
Show First 20 Lines • Show All 164 Lines • ▼ Show 20 Lines | error: | ||||
dwc_otg_detach(dev); | dwc_otg_detach(dev); | ||||
return (ENXIO); | return (ENXIO); | ||||
} | } | ||||
int | int | ||||
dwc_otg_detach(device_t dev) | dwc_otg_detach(device_t dev) | ||||
{ | { | ||||
struct dwc_otg_fdt_softc *sc = device_get_softc(dev); | struct dwc_otg_fdt_softc *sc = device_get_softc(dev); | ||||
int err; | |||||
/* during module unload there are lots of children leftover */ | /* during module unload there are lots of children leftover */ | ||||
device_delete_children(dev); | device_delete_children(dev); | ||||
if (sc->sc_otg.sc_irq_res && sc->sc_otg.sc_intr_hdl) { | if (sc->sc_otg.sc_irq_res && sc->sc_otg.sc_intr_hdl) { | ||||
/* | /* | ||||
* only call dwc_otg_uninit() after dwc_otg_init() | * only call dwc_otg_uninit() after dwc_otg_init() | ||||
*/ | */ | ||||
dwc_otg_uninit(&sc->sc_otg); | dwc_otg_uninit(&sc->sc_otg); | ||||
err = bus_teardown_intr(dev, sc->sc_otg.sc_irq_res, | bus_teardown_intr(dev, sc->sc_otg.sc_irq_res, | ||||
sc->sc_otg.sc_intr_hdl); | sc->sc_otg.sc_intr_hdl); | ||||
sc->sc_otg.sc_intr_hdl = NULL; | sc->sc_otg.sc_intr_hdl = NULL; | ||||
} | } | ||||
/* free IRQ channel, if any */ | /* free IRQ channel, if any */ | ||||
if (sc->sc_otg.sc_irq_res) { | if (sc->sc_otg.sc_irq_res) { | ||||
bus_release_resource(dev, SYS_RES_IRQ, 0, | bus_release_resource(dev, SYS_RES_IRQ, 0, | ||||
sc->sc_otg.sc_irq_res); | sc->sc_otg.sc_irq_res); | ||||
sc->sc_otg.sc_irq_res = NULL; | sc->sc_otg.sc_irq_res = NULL; | ||||
Show All 34 Lines |