From b9585d5e60d015a6b41edfba193dbc3f3977e8bb Mon Sep 17 00:00:00 2001 From: Nate Lawson Date: Mon, 12 Jan 2004 19:35:31 +0000 Subject: Only remove the handler if we installed it. --- sys/dev/acpi_support/acpi_toshiba.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sys/dev/acpi_support') diff --git a/sys/dev/acpi_support/acpi_toshiba.c b/sys/dev/acpi_support/acpi_toshiba.c index 9f582d4aed3e..23d2d31a639a 100644 --- a/sys/dev/acpi_support/acpi_toshiba.c +++ b/sys/dev/acpi_support/acpi_toshiba.c @@ -256,8 +256,10 @@ acpi_toshiba_detach(device_t dev) ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); sc = device_get_softc(dev); - AcpiRemoveNotifyHandler(sc->handle, ACPI_DEVICE_NOTIFY, - acpi_toshiba_notify); + if (enable_fn_keys != 0) { + AcpiRemoveNotifyHandler(sc->handle, ACPI_DEVICE_NOTIFY, + acpi_toshiba_notify); + } sysctl_ctx_free(&sc->sysctl_ctx); return (0); -- cgit v1.3