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

Function zy7_devcfg_detach

freebsd/arm/xilinx/zy7_devcfg.c:795–830  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

793}
794
795static int
796zy7_devcfg_detach(device_t dev)
797{
798 struct zy7_devcfg_softc *sc = device_get_softc(dev);
799
800 if (sc->sysctl_tree_top != NULL) {
801 sysctl_ctx_free(&sc->sysctl_tree);
802 sc->sysctl_tree_top = NULL;
803 }
804
805 if (device_is_attached(dev))
806 bus_generic_detach(dev);
807
808 /* Get rid of /dev/devcfg0. */
809 if (sc->sc_ctl_dev != NULL)
810 destroy_dev(sc->sc_ctl_dev);
811
812 /* Teardown and release interrupt. */
813 if (sc->irq_res != NULL) {
814 if (sc->intrhandle)
815 bus_teardown_intr(dev, sc->irq_res, sc->intrhandle);
816 bus_release_resource(dev, SYS_RES_IRQ,
817 rman_get_rid(sc->irq_res), sc->irq_res);
818 }
819
820 /* Release memory resource. */
821 if (sc->mem_res != NULL)
822 bus_release_resource(dev, SYS_RES_MEMORY,
823 rman_get_rid(sc->mem_res), sc->mem_res);
824
825 zy7_devcfg_softc_p = NULL;
826
827 DEVCFG_SC_LOCK_DESTROY(sc);
828
829 return (0);
830}
831
832static device_method_t zy7_devcfg_methods[] = {
833 /* device_if */

Callers 1

zy7_devcfg_attachFunction · 0.85

Calls 8

device_get_softcFunction · 0.85
sysctl_ctx_freeFunction · 0.85
device_is_attachedFunction · 0.85
bus_generic_detachFunction · 0.85
destroy_devFunction · 0.85
bus_teardown_intrFunction · 0.85
bus_release_resourceFunction · 0.85
rman_get_ridFunction · 0.85

Tested by

no test coverage detected