int fscpos_detect(struct i2c_adapter *adapter, int address, int kind) 
static int fscpos_detect(struct i2c_adapter *adapter, int address, int kind) 
int fscpos_detect(struct i2c_adapter *adapter, int address, int kind){	struct i2c_client *new_client;	struct fscpos_data *data;	int err = 0;	if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA))		goto exit;	/*	 * OK. For now, we presume we have a valid client. We now create the	 * client structure, even though we cannot fill it completely yet.	 * But it allows us to access fscpos_{read,write}_value.	 */	if (!(data = kzalloc(sizeof(struct fscpos_data), GFP_KERNEL))) {		err = -ENOMEM;		goto exit;	}	new_client = &data->client;	i2c_set_clientdata(new_client, data);	new_client->addr = address;	new_client->adapter = adapter;	new_client->driver = &fscpos_driver;	new_client->flags = 0;	/* Do the remaining detection unless force or force_fscpos parameter */	if (kind < 0) {		if ((fscpos_read_value(new_client, FSCPOS_REG_IDENT_0)			!= 0x50) /* 'P' */		|| (fscpos_read_value(new_client, FSCPOS_REG_IDENT_1)			!= 0x45) /* 'E' */		|| (fscpos_read_value(new_client, FSCPOS_REG_IDENT_2)			!= 0x47))/* 'G' */		{			dev_dbg(&new_client->dev, "fscpos detection failed\n");			goto exit_free;		}	}	/* Fill in the remaining client fields and put it in the global list */	strlcpy(new_client->name, "fscpos", I2C_NAME_SIZE);	data->valid = 0;	init_MUTEX(&data->update_lock);	/* Tell the I2C layer a new client has arrived */	if ((err = i2c_attach_client(new_client)))		goto exit_free;	/* Inizialize the fscpos chip */	fscpos_init_client(new_client);	/* Announce that the chip was found */	dev_info(&new_client->dev, "Found fscpos chip, rev %u\n", data->revision);	/* Register sysfs hooks */	data->class_dev = hwmon_device_register(&new_client->dev);	if (IS_ERR(data->class_dev)) {		err = PTR_ERR(data->class_dev);		goto exit_detach;	}	device_create_file(&new_client->dev, &dev_attr_event);	device_create_file(&new_client->dev, &dev_attr_in0_input);	device_create_file(&new_client->dev, &dev_attr_in1_input);	device_create_file(&new_client->dev, &dev_attr_in2_input);	device_create_file(&new_client->dev, &dev_attr_wdog_control);	device_create_file(&new_client->dev, &dev_attr_wdog_preset);	device_create_file(&new_client->dev, &dev_attr_wdog_state);	device_create_file(&new_client->dev, &dev_attr_temp1_input);	device_create_file(&new_client->dev, &dev_attr_temp1_status);	device_create_file(&new_client->dev, &dev_attr_temp1_reset);	device_create_file(&new_client->dev, &dev_attr_temp2_input);	device_create_file(&new_client->dev, &dev_attr_temp2_status);	device_create_file(&new_client->dev, &dev_attr_temp2_reset);	device_create_file(&new_client->dev, &dev_attr_temp3_input);	device_create_file(&new_client->dev, &dev_attr_temp3_status);	device_create_file(&new_client->dev, &dev_attr_temp3_reset);	device_create_file(&new_client->dev, &dev_attr_fan1_input);	device_create_file(&new_client->dev, &dev_attr_fan1_status);	device_create_file(&new_client->dev, &dev_attr_fan1_ripple);	device_create_file(&new_client->dev, &dev_attr_pwm1);	device_create_file(&new_client->dev, &dev_attr_fan2_input);	device_create_file(&new_client->dev, &dev_attr_fan2_status);	device_create_file(&new_client->dev, &dev_attr_fan2_ripple);	device_create_file(&new_client->dev, &dev_attr_pwm2);	device_create_file(&new_client->dev, &dev_attr_fan3_input);	device_create_file(&new_client->dev, &dev_attr_fan3_status);	device_create_file(&new_client->dev, &dev_attr_fan3_ripple);	return 0;exit_detach:	i2c_detach_client(new_client);exit_free:	kfree(data);exit:	return err;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/c49efceffa599299ab3f38b1cdf8c2f1bf9811c4/fscpos.c/clean/drivers/hwmon/fscpos.c