spin_lock_init(&ec->lock); 
atomic_set(&ec->pending_gpe, 0); atomic_set(&ec->leaving_burst , 1); init_MUTEX(&ec->sem); init_waitqueue_head(&ec->wait); 
acpi_ec_add (	struct acpi_device	*device){	int			result = 0;	acpi_status		status = AE_OK;	struct acpi_ec		*ec = NULL;	unsigned long		uid;	ACPI_FUNCTION_TRACE("acpi_ec_add");	if (!device)		return_VALUE(-EINVAL);	ec = kmalloc(sizeof(struct acpi_ec), GFP_KERNEL);	if (!ec)		return_VALUE(-ENOMEM);	memset(ec, 0, sizeof(struct acpi_ec));	ec->handle = device->handle;	ec->uid = -1;	spin_lock_init(&ec->lock);	strcpy(acpi_device_name(device), ACPI_EC_DEVICE_NAME);	strcpy(acpi_device_class(device), ACPI_EC_CLASS);	acpi_driver_data(device) = ec;	/* Use the global lock for all EC transactions? */	acpi_evaluate_integer(ec->handle, "_GLK", NULL, &ec->global_lock);	/* If our UID matches the UID for the ECDT-enumerated EC,	   we now have the *real* EC info, so kill the makeshift one.*/	acpi_evaluate_integer(ec->handle, "_UID", NULL, &uid);	if (ec_ecdt && ec_ecdt->uid == uid) {		acpi_remove_address_space_handler(ACPI_ROOT_OBJECT,			ACPI_ADR_SPACE_EC, &acpi_ec_space_handler);			acpi_remove_gpe_handler(NULL, ec_ecdt->gpe_bit, &acpi_ec_gpe_handler);		kfree(ec_ecdt);	}	/* Get GPE bit assignment (EC events). */	/* TODO: Add support for _GPE returning a package */	status = acpi_evaluate_integer(ec->handle, "_GPE", NULL, &ec->gpe_bit);	if (ACPI_FAILURE(status)) {		ACPI_DEBUG_PRINT((ACPI_DB_ERROR,			"Error obtaining GPE bit assignment\n"));		result = -ENODEV;		goto end;	}	result = acpi_ec_add_fs(device);	if (result)		goto end;	printk(KERN_INFO PREFIX "%s [%s] (gpe %d)\n",		acpi_device_name(device), acpi_device_bid(device),		(u32) ec->gpe_bit);	if (!first_ec)		first_ec = device;end:	if (result)		kfree(ec);	return_VALUE(result);}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/451566f45a2e6cd10ba56e7220a9dd84ba3ef550/ec.c/buggy/drivers/acpi/ec.c