예제 #1
0
파일: vmt.c 프로젝트: goroutines/rumprun
static int
vmt_detach(device_t self, int flags)
{
	struct vmt_softc *sc = device_private(self);

	if (sc->sc_tclo_rpc_open)
		vm_rpc_close(&sc->sc_tclo_rpc);

	if (sc->sc_smpsw_valid) {
		sysmon_pswitch_unregister(&sc->sc_ev_sleep.ev_smpsw);
		sysmon_pswitch_unregister(&sc->sc_ev_reset.ev_smpsw);
		sysmon_pswitch_unregister(&sc->sc_ev_power.ev_smpsw);
	}

	callout_halt(&sc->sc_tick, NULL);
	callout_destroy(&sc->sc_tick);

	callout_halt(&sc->sc_tclo_tick, NULL);
	callout_destroy(&sc->sc_tclo_tick);

	callout_halt(&sc->sc_clock_sync_tick, NULL);
	callout_destroy(&sc->sc_clock_sync_tick);

	if (sc->sc_rpc_buf)
		kmem_free(sc->sc_rpc_buf, VMT_RPC_BUFLEN);

	if (sc->sc_log) {
		sysctl_teardown(&sc->sc_log);
		sc->sc_log = NULL;
	}

	return 0;
}
예제 #2
0
static int
acpi_dalb_detach(device_t self, int flags)
{
	struct acpi_dalb_softc *sc = device_private(self);

	pmf_device_deregister(self);
	acpi_deregister_notify(sc->sc_node);
	sysmon_pswitch_unregister(&sc->sc_smpsw);

	return 0;
}
예제 #3
0
파일: fujhk_acpi.c 프로젝트: ryo/netbsd-src
static int
fujitsu_hk_detach(device_t self, int flags)
{
    struct fujitsu_hk_softc *sc = device_private(self);
    int i;

    pmf_device_deregister(self);

    if (sc->sc_log != NULL)
        sysctl_teardown(&sc->sc_log);

    acpi_deregister_notify(sc->sc_node);

    for (i = 0; i < FUJITSU_HK_PSW_COUNT; i++)
        sysmon_pswitch_unregister(&sc->sc_smpsw[i]);

    mutex_destroy(&sc->sc_mtx);

    return 0;
}
예제 #4
0
static int
thinkpad_detach(device_t self, int flags)
{
	struct thinkpad_softc *sc = device_private(self);
	int i;

	acpi_deregister_notify(sc->sc_node);

	for (i = 0; i < TP_PSW_LAST; i++)
		sysmon_pswitch_unregister(&sc->sc_smpsw[i]);

	if (sc->sc_sme != NULL)
		sysmon_envsys_unregister(sc->sc_sme);

	pmf_device_deregister(self);

	pmf_event_deregister(self, PMFE_DISPLAY_BRIGHTNESS_UP,
	    thinkpad_brightness_up, true);

	pmf_event_deregister(self, PMFE_DISPLAY_BRIGHTNESS_DOWN,
	    thinkpad_brightness_down, true);

	return 0;
}
예제 #5
0
static int
asus_detach(device_t self, int flags)
{
	struct asus_softc *sc = device_private(self);
	int i;

	acpi_deregister_notify(sc->sc_node);

	if (sc->sc_smpsw_valid != false) {

		for (i = 0; i < ASUS_PSW_LAST; i++)
			sysmon_pswitch_unregister(&sc->sc_smpsw[i]);
	}

	if (sc->sc_sme != NULL)
		sysmon_envsys_unregister(sc->sc_sme);

	if (sc->sc_log != NULL)
		sysctl_teardown(&sc->sc_log);

	pmf_device_deregister(self);

	return 0;
}