acpi_status		status; struct acpi_table_ecdt 	*ecdt_ptr;  status = acpi_get_firmware_table("ECDT", 1, ACPI_LOGICAL_ADDRESSING, (struct acpi_table_header **) &ecdt_ptr); if (ACPI_FAILURE(status)) return -ENODEV;  printk(KERN_INFO PREFIX "Found ECDT\n");  /* * Generate a temporary ec context to use until the namespace is scanned */ ec_ecdt = kmalloc(sizeof(struct acpi_ec), GFP_KERNEL); if (!ec_ecdt) return -ENOMEM; memset(ec_ecdt, 0, sizeof(struct acpi_ec));  init_MUTEX(&ec_ecdt->sem); init_waitqueue_head(&ec_ecdt->wait); ec_ecdt->command_addr = ecdt_ptr->ec_control; ec_ecdt->status_addr = ecdt_ptr->ec_control; ec_ecdt->data_addr = ecdt_ptr->ec_data; ec_ecdt->gpe_bit = ecdt_ptr->gpe_bit; /* use the GL just to be safe */ ec_ecdt->global_lock = TRUE; ec_ecdt->uid = ecdt_ptr->uid;  status = acpi_get_handle(NULL, ecdt_ptr->ec_id, &ec_ecdt->handle); if (ACPI_FAILURE(status)) { goto error; }  return 0; error: printk(KERN_ERR PREFIX "Could not use ECDT\n"); kfree(ec_ecdt); ec_ecdt = NULL;  return -ENODEV; 
if (acpi_ec_polling_mode) return acpi_ec_polling_get_real_ecdt(); else return acpi_ec_burst_get_real_ecdt(); 
acpi_ec_get_real_ecdt(void){	acpi_status		status;	struct acpi_table_ecdt 	*ecdt_ptr;	status = acpi_get_firmware_table("ECDT", 1, ACPI_LOGICAL_ADDRESSING,		(struct acpi_table_header **) &ecdt_ptr);	if (ACPI_FAILURE(status))		return -ENODEV;	printk(KERN_INFO PREFIX "Found ECDT\n");	/*	 * Generate a temporary ec context to use until the namespace is scanned	 */	ec_ecdt = kmalloc(sizeof(struct acpi_ec), GFP_KERNEL);	if (!ec_ecdt)		return -ENOMEM;	memset(ec_ecdt, 0, sizeof(struct acpi_ec)); 	init_MUTEX(&ec_ecdt->sem); 	init_waitqueue_head(&ec_ecdt->wait);	ec_ecdt->command_addr = ecdt_ptr->ec_control;	ec_ecdt->status_addr = ecdt_ptr->ec_control;	ec_ecdt->data_addr = ecdt_ptr->ec_data;	ec_ecdt->gpe_bit = ecdt_ptr->gpe_bit;	/* use the GL just to be safe */	ec_ecdt->global_lock = TRUE;	ec_ecdt->uid = ecdt_ptr->uid;	status = acpi_get_handle(NULL, ecdt_ptr->ec_id, &ec_ecdt->handle);	if (ACPI_FAILURE(status)) {		goto error;	}	return 0;error:	printk(KERN_ERR PREFIX "Could not use ECDT\n");	kfree(ec_ecdt);	ec_ecdt = NULL;	return -ENODEV;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/45bea1555f5bf0cd5871b208b4b02d188f106861/ec.c/buggy/drivers/acpi/ec.c