MCPcopy Create free account
hub / github.com/F-Stack/f-stack / dotg_fdt_detach

Function dotg_fdt_detach

freebsd/mips/mediatek/mtk_dotg.c:139–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137}
138
139static int
140dotg_fdt_detach(device_t dev)
141{
142 struct dwc_otg_softc *sc = device_get_softc(dev);
143 int err;
144
145 /* during module unload there are lots of children leftover */
146 device_delete_children(dev);
147
148 if (sc->sc_irq_res && sc->sc_intr_hdl) {
149 /*
150 * only call dotg_fdt_uninit() after dotg_fdt_init()
151 */
152 dwc_otg_uninit(sc);
153
154 err = bus_teardown_intr(dev, sc->sc_irq_res,
155 sc->sc_intr_hdl);
156 sc->sc_intr_hdl = NULL;
157 }
158 if (sc->sc_irq_res) {
159 bus_release_resource(dev, SYS_RES_IRQ, 0,
160 sc->sc_irq_res);
161 sc->sc_irq_res = NULL;
162 }
163 if (sc->sc_io_res) {
164 bus_release_resource(dev, SYS_RES_MEMORY, 0,
165 sc->sc_io_res);
166 sc->sc_io_res = NULL;
167 }
168 usb_bus_mem_free_all(&sc->sc_bus, NULL);
169
170 return (0);
171}
172
173static device_method_t dotg_fdt_methods[] = {
174 /* Device interface */

Callers 1

dotg_fdt_attachFunction · 0.85

Calls 4

device_get_softcFunction · 0.85
device_delete_childrenFunction · 0.85
bus_teardown_intrFunction · 0.85
bus_release_resourceFunction · 0.85

Tested by

no test coverage detected