int eeprom_detect(struct i2c_adapter *adapter, int address, int kind) 
static int eeprom_detect(struct i2c_adapter *adapter, int address, int kind) 
int eeprom_detect(struct i2c_adapter *adapter, int address, int kind){	struct i2c_client *new_client;	struct eeprom_data *data;	int err = 0;	/* There are three ways we can read the EEPROM data:	   (1) I2C block reads (faster, but unsupported by most adapters)	   (2) Consecutive byte reads (100% overhead)	   (3) Regular byte data reads (200% overhead)	   The third method is not implemented by this driver because all	   known adapters support at least the second. */	if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_READ_BYTE_DATA					    | I2C_FUNC_SMBUS_BYTE))		goto exit;	if (!(data = kzalloc(sizeof(struct eeprom_data), GFP_KERNEL))) {		err = -ENOMEM;		goto exit;	}	new_client = &data->client;	memset(data->data, 0xff, EEPROM_SIZE);	i2c_set_clientdata(new_client, data);	new_client->addr = address;	new_client->adapter = adapter;	new_client->driver = &eeprom_driver;	new_client->flags = 0;	/* Fill in the remaining client fields */	strlcpy(new_client->name, "eeprom", I2C_NAME_SIZE);	data->valid = 0;	init_MUTEX(&data->update_lock);	data->nature = UNKNOWN;	/* Tell the I2C layer a new client has arrived */	if ((err = i2c_attach_client(new_client)))		goto exit_kfree;	/* Detect the Vaio nature of EEPROMs.	   We use the "PCG-" prefix as the signature. */	if (address == 0x57) {		if (i2c_smbus_read_byte_data(new_client, 0x80) == 'P'		 && i2c_smbus_read_byte(new_client) == 'C'		 && i2c_smbus_read_byte(new_client) == 'G'		 && i2c_smbus_read_byte(new_client) == '-') {			dev_info(&new_client->dev, "Vaio EEPROM detected, "				"enabling password protection\n");			data->nature = VAIO;		}	}	/* create the sysfs eeprom file */	sysfs_create_bin_file(&new_client->dev.kobj, &eeprom_attr);	return 0;exit_kfree:	kfree(data);exit:	return err;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/6536c49a1ee2bd85eee0e7fa41e67c5743f2f93e/eeprom.c/clean/drivers/i2c/chips/eeprom.c