memset(data, 0, sizeof(struct w83627ehf_data)); 
static int w83627ehf_detect(struct i2c_adapter *adapter){	struct i2c_client *client;	struct w83627ehf_data *data;	int i, err = 0;	if (!request_region(address + REGION_OFFSET, REGION_LENGTH,	                    w83627ehf_driver.name)) {		err = -EBUSY;		goto exit;	}	if (!(data = kmalloc(sizeof(struct w83627ehf_data), GFP_KERNEL))) {		err = -ENOMEM;		goto exit_release;	}	memset(data, 0, sizeof(struct w83627ehf_data));	client = &data->client;	i2c_set_clientdata(client, data);	client->addr = address;	init_MUTEX(&data->lock);	client->adapter = adapter;	client->driver = &w83627ehf_driver;	client->flags = 0;	strlcpy(client->name, "w83627ehf", 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(client)))		goto exit_free;	/* Initialize the chip */	w83627ehf_init_client(client);	/* A few vars need to be filled upon startup */	for (i = 0; i < 5; i++)		data->fan_min[i] = w83627ehf_read_value(client,				   W83627EHF_REG_FAN_MIN[i]);	/* It looks like fan4 and fan5 pins can be alternatively used	   as fan on/off switches */	data->has_fan = 0x07; /* fan1, fan2 and fan3 */	i = w83627ehf_read_value(client, W83627EHF_REG_FANDIV1);	if (i & (1 << 2))		data->has_fan |= (1 << 3);	if (i & (1 << 0))		data->has_fan |= (1 << 4);	/* Register sysfs hooks */	data->class_dev = hwmon_device_register(&client->dev);	if (IS_ERR(data->class_dev)) {		err = PTR_ERR(data->class_dev);		goto exit_detach;	}	device_create_file(&client->dev, &dev_attr_fan1_input);	device_create_file(&client->dev, &dev_attr_fan1_min);	device_create_file(&client->dev, &dev_attr_fan1_div);	device_create_file(&client->dev, &dev_attr_fan2_input);	device_create_file(&client->dev, &dev_attr_fan2_min);	device_create_file(&client->dev, &dev_attr_fan2_div);	device_create_file(&client->dev, &dev_attr_fan3_input);	device_create_file(&client->dev, &dev_attr_fan3_min);	device_create_file(&client->dev, &dev_attr_fan3_div);	if (data->has_fan & (1 << 3)) {		device_create_file(&client->dev, &dev_attr_fan4_input);		device_create_file(&client->dev, &dev_attr_fan4_min);		device_create_file(&client->dev, &dev_attr_fan4_div);	}	if (data->has_fan & (1 << 4)) {		device_create_file(&client->dev, &dev_attr_fan5_input);		device_create_file(&client->dev, &dev_attr_fan5_min);		device_create_file(&client->dev, &dev_attr_fan5_div);	}	device_create_file(&client->dev, &dev_attr_temp1_input);	device_create_file(&client->dev, &dev_attr_temp1_max);	device_create_file(&client->dev, &dev_attr_temp1_max_hyst);	device_create_file(&client->dev, &dev_attr_temp2_input);	device_create_file(&client->dev, &dev_attr_temp2_max);	device_create_file(&client->dev, &dev_attr_temp2_max_hyst);	device_create_file(&client->dev, &dev_attr_temp3_input);	device_create_file(&client->dev, &dev_attr_temp3_max);	device_create_file(&client->dev, &dev_attr_temp3_max_hyst);	return 0;exit_detach:	i2c_detach_client(client);exit_free:	kfree(data);exit_release:	release_region(address + REGION_OFFSET, REGION_LENGTH);exit:	return err;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/ba9c2e8d15da029ea3051c95e446b2d638ef02e2/w83627ehf.c/buggy/drivers/hwmon/w83627ehf.c