tegra_xhci.c (5b56413d04e608379c9a306373554a8e4d321bc0) | tegra_xhci.c (3ddaf8200bc90b1410755ebac7b5c979ea90a2f6) |
---|---|
1/*- 2 * Copyright (c) 2016 Michal Meloun <mmel@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 902 unchanged lines hidden (view full) --- 911 return (ENXIO); 912} 913 914static int 915tegra_xhci_detach(device_t dev) 916{ 917 struct tegra_xhci_softc *sc; 918 struct xhci_softc *xsc; | 1/*- 2 * Copyright (c) 2016 Michal Meloun <mmel@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 902 unchanged lines hidden (view full) --- 911 return (ENXIO); 912} 913 914static int 915tegra_xhci_detach(device_t dev) 916{ 917 struct tegra_xhci_softc *sc; 918 struct xhci_softc *xsc; |
919 int error; |
|
919 920 sc = device_get_softc(dev); 921 xsc = &sc->xhci_softc; 922 923 /* during module unload there are lots of children leftover */ | 920 921 sc = device_get_softc(dev); 922 xsc = &sc->xhci_softc; 923 924 /* during module unload there are lots of children leftover */ |
924 device_delete_children(dev); | 925 error = bus_generic_detach(dev); 926 if (error != 0) 927 return (error); 928 |
925 if (sc->xhci_inited) { 926 usb_callout_drain(&xsc->sc_callout); 927 xhci_halt_controller(xsc); 928 } 929 930 if (xsc->sc_irq_res && xsc->sc_intr_hdl) { 931 bus_teardown_intr(dev, xsc->sc_irq_res, xsc->sc_intr_hdl); 932 xsc->sc_intr_hdl = NULL; --- 190 unchanged lines hidden --- | 929 if (sc->xhci_inited) { 930 usb_callout_drain(&xsc->sc_callout); 931 xhci_halt_controller(xsc); 932 } 933 934 if (xsc->sc_irq_res && xsc->sc_intr_hdl) { 935 bus_teardown_intr(dev, xsc->sc_irq_res, xsc->sc_intr_hdl); 936 xsc->sc_intr_hdl = NULL; --- 190 unchanged lines hidden --- |