diff options
Diffstat (limited to 'sys/dev/usb/controller/dwc_otg_fdt.c')
-rw-r--r-- | sys/dev/usb/controller/dwc_otg_fdt.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/dev/usb/controller/dwc_otg_fdt.c b/sys/dev/usb/controller/dwc_otg_fdt.c index ea46494df8d9..2ed94b23212c 100644 --- a/sys/dev/usb/controller/dwc_otg_fdt.c +++ b/sys/dev/usb/controller/dwc_otg_fdt.c @@ -140,10 +140,6 @@ dwc_otg_attach(device_t dev) if (sc->sc_otg.sc_irq_res == NULL) goto error; - sc->sc_otg.sc_bus.bdev = device_add_child(dev, "usbus", -1); - if (sc->sc_otg.sc_bus.bdev == NULL) - goto error; - err = dwc_otg_init(&sc->sc_otg); if (err == 0) { err = device_probe_and_attach(sc->sc_otg.sc_bus.bdev); @@ -162,9 +158,12 @@ int dwc_otg_detach(device_t dev) { struct dwc_otg_fdt_softc *sc = device_get_softc(dev); + int error; /* during module unload there are lots of children leftover */ - device_delete_children(dev); + error = bus_generic_detach(dev); + if (error != 0) + return (error); if (sc->sc_otg.sc_irq_res && sc->sc_otg.sc_intr_hdl) { /* |