static void acpi_device_remove_notify_handler(struct acpi_device *device) { if (device->device_type == ACPI_BUS_TYPE_POWER_BUTTON) acpi_remove_fixed_event_handler(ACPI_EVENT_POWER_BUTTON, acpi_device_fixed_event); else if (device->device_type == ACPI_BUS_TYPE_SLEEP_BUTTON) acpi_remove_fixed_event_handler(ACPI_EVENT_SLEEP_BUTTON, acpi_device_fixed_event); else acpi_remove_notify_handler(device->handle, ACPI_DEVICE_NOTIFY, acpi_device_notify); }
acpi_status acpi_ev_remove_global_lock_handler(void) { acpi_status status; ACPI_FUNCTION_TRACE(ev_remove_global_lock_handler); acpi_gbl_global_lock_present = FALSE; status = acpi_remove_fixed_event_handler(ACPI_EVENT_GLOBAL, acpi_ev_global_lock_handler); return_ACPI_STATUS(status); }
acpi_status bn_remove_device( void **context) { acpi_status status = AE_OK; BN_CONTEXT *button = NULL; FUNCTION_TRACE("bn_remove_device"); if (!context || !*context) { return_ACPI_STATUS(AE_BAD_PARAMETER); } button = (BN_CONTEXT*)*context; ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Removing button device [%02x].\n", button->device_handle)); /* * Unregister for fixed-feature events. */ switch (button->type) { case BN_TYPE_POWER_BUTTON_FIXED: status = acpi_remove_fixed_event_handler( ACPI_EVENT_POWER_BUTTON, bn_notify_fixed); break; case BN_TYPE_SLEEP_BUTTON_FIXED: status = acpi_remove_fixed_event_handler( ACPI_EVENT_SLEEP_BUTTON, bn_notify_fixed); break; } bn_osl_remove_device(button); acpi_os_free(button); *context = NULL; return_ACPI_STATUS(status); }
static int acpi_button_remove (struct acpi_device *device, int type) { acpi_status status = 0; struct acpi_button *button = NULL; ACPI_FUNCTION_TRACE("acpi_button_remove"); if (!device || !acpi_driver_data(device)) return_VALUE(-EINVAL); button = acpi_driver_data(device); /* Unregister for device notifications. */ switch (button->type) { case ACPI_BUTTON_TYPE_POWERF: status = acpi_remove_fixed_event_handler( ACPI_EVENT_POWER_BUTTON, acpi_button_notify_fixed); break; case ACPI_BUTTON_TYPE_SLEEPF: status = acpi_remove_fixed_event_handler( ACPI_EVENT_SLEEP_BUTTON, acpi_button_notify_fixed); break; default: status = acpi_remove_notify_handler(button->handle, ACPI_DEVICE_NOTIFY, acpi_button_notify); break; } if (ACPI_FAILURE(status)) ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error removing notify handler\n")); acpi_button_remove_fs(device); kfree(button); return_VALUE(0); }