acpi_os_acquire_lock (acpi_gbl_gpe_lock, ACPI_NOT_ISR); 
flags = acpi_os_acquire_lock (acpi_gbl_gpe_lock); 
acpi_remove_gpe_handler (	acpi_handle                     gpe_device,	u32                             gpe_number,	acpi_event_handler              address){	struct acpi_gpe_event_info      *gpe_event_info;	struct acpi_handler_info        *handler;	acpi_status                     status;	ACPI_FUNCTION_TRACE ("acpi_remove_gpe_handler");	/* Parameter validation */	if (!address) {		return_ACPI_STATUS (AE_BAD_PARAMETER);	}	status = acpi_ut_acquire_mutex (ACPI_MTX_EVENTS);	if (ACPI_FAILURE (status)) {		return_ACPI_STATUS (status);	}	/* Ensure that we have a valid GPE number */	gpe_event_info = acpi_ev_get_gpe_event_info (gpe_device, gpe_number);	if (!gpe_event_info) {		status = AE_BAD_PARAMETER;		goto unlock_and_exit;	}	/* Make sure that a handler is indeed installed */	if ((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) != ACPI_GPE_DISPATCH_HANDLER) {		status = AE_NOT_EXIST;		goto unlock_and_exit;	}	/* Make sure that the installed handler is the same */	if (gpe_event_info->dispatch.handler->address != address) {		status = AE_BAD_PARAMETER;		goto unlock_and_exit;	}	/* Disable the GPE before removing the handler */	status = acpi_ev_disable_gpe (gpe_event_info);	if (ACPI_FAILURE (status)) {		goto unlock_and_exit;	}	/* Make sure all deferred tasks are completed */	(void) acpi_ut_release_mutex (ACPI_MTX_EVENTS);	acpi_os_wait_events_complete(NULL);	status = acpi_ut_acquire_mutex (ACPI_MTX_EVENTS);	if (ACPI_FAILURE (status)) {		return_ACPI_STATUS (status); 	}	/* Remove the handler */	acpi_os_acquire_lock (acpi_gbl_gpe_lock, ACPI_NOT_ISR);	handler = gpe_event_info->dispatch.handler;	/* Restore Method node (if any), set dispatch flags */	gpe_event_info->dispatch.method_node = handler->method_node;	gpe_event_info->flags &= ~ACPI_GPE_DISPATCH_MASK; /* Clear bits */	if (handler->method_node) {		gpe_event_info->flags |= ACPI_GPE_DISPATCH_METHOD;	}	acpi_os_release_lock (acpi_gbl_gpe_lock, ACPI_NOT_ISR);	/* Now we can free the handler object */	ACPI_MEM_FREE (handler);unlock_and_exit:	(void) acpi_ut_release_mutex (ACPI_MTX_EVENTS);	return_ACPI_STATUS (status);}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/73459f73e5d1602c59ebec114fc45185521353c1/evxface.c/clean/drivers/acpi/events/evxface.c