memset(data, 0, sizeof(struct fscher_data)); 
static int fscher_detect(struct i2c_adapter *adapter, int address, int kind){	struct i2c_client *new_client;	struct fscher_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 i2c_smbus_read_byte_data. */	if (!(data = kmalloc(sizeof(struct fscher_data), GFP_KERNEL))) {		err = -ENOMEM;		goto exit;  	}	memset(data, 0, sizeof(struct fscher_data));	/* The common I2C client data is placed right before the	 * Hermes-specific data. */	new_client = &data->client;	i2c_set_clientdata(new_client, data);	new_client->addr = address;	new_client->adapter = adapter;	new_client->driver = &fscher_driver;	new_client->flags = 0;	/* Do the remaining detection unless force or force_fscher parameter */	if (kind < 0) {		if ((i2c_smbus_read_byte_data(new_client,		     FSCHER_REG_IDENT_0) != 0x48)	/* 'H' */		 || (i2c_smbus_read_byte_data(new_client,		     FSCHER_REG_IDENT_1) != 0x45)	/* 'E' */		 || (i2c_smbus_read_byte_data(new_client,		     FSCHER_REG_IDENT_2) != 0x52))	/* 'R' */			goto exit_free;	}	/* Fill in the remaining client fields and put it into the	 * global list */	strlcpy(new_client->name, "fscher", 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;	fscher_init_client(new_client);	/* 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_revision(new_client);	device_create_file_alarms(new_client);	device_create_file_control(new_client);	device_create_file_watchdog(new_client);	device_create_file_in(new_client, 0);	device_create_file_in(new_client, 1);	device_create_file_in(new_client, 2);	device_create_file_fan(new_client, 1);	device_create_file_fan(new_client, 2);	device_create_file_fan(new_client, 3);	device_create_file_temp(new_client, 1);	device_create_file_temp(new_client, 2);	device_create_file_temp(new_client, 3);	return 0;exit_detach:	i2c_detach_client(new_client);exit_free:	kfree(data);exit:	return err;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/ba9c2e8d15da029ea3051c95e446b2d638ef02e2/fscher.c/clean/drivers/hwmon/fscher.c