static int itesio_isa_detach(device_t self, int flags) { struct itesio_softc *sc = device_private(self); if (sc->sc_hwmon_enabled) sysmon_envsys_unregister(sc->sc_sme); if (sc->sc_hwmon_mapped) bus_space_unmap(sc->sc_ec_iot, sc->sc_ec_ioh, 8); if (sc->sc_wdt_enabled) { sysmon_wdog_unregister(&sc->sc_smw); bus_space_unmap(sc->sc_iot, sc->sc_ioh, 2); } return 0; }
static int geode_wdog_detach(device_t self, int flags) { int rc; struct geode_wdog_softc *sc = device_private(self); if ((rc = sysmon_wdog_unregister(&sc->sc_smw)) != 0) { if (rc == ERESTART) rc = EINTR; return rc; } /* cancel any pending countdown */ geode_wdog_disable(sc); attached = 0; return 0; }
static int acpi_wdrt_detach(device_t self, int flags) { struct acpi_wdrt_softc *sc = device_private(self); /* Don't allow detach if watchdog is armed */ if (sc->sc_smw_valid && (sc->sc_smw.smw_mode & WDOG_MODE_MASK) != WDOG_MODE_DISARMED) return EBUSY; if (sc->sc_smw_valid) { sysmon_wdog_unregister(&sc->sc_smw); sc->sc_smw_valid = false; } pmf_device_deregister(self); return 0; }
static int pwdog_detach(device_t self, int flags) { struct pwdog_softc *sc = device_private(self); /* XXX check flags & DETACH_FORCE (or DETACH_SHUTDOWN)? */ if (sc->sc_smw_valid) { if ((sc->sc_smw.smw_mode & WDOG_MODE_MASK) != WDOG_MODE_DISARMED) return EBUSY; sysmon_wdog_unregister(&sc->sc_smw); sc->sc_smw_valid = false; } pmf_device_deregister(self); if (sc->sc_iosize) bus_space_unmap(sc->sc_iot, sc->sc_ioh, sc->sc_iosize); return 0; }