memset(data, 0, sizeof(struct lm92_data)); 
static int lm92_detect(struct i2c_adapter *adapter, int address, int kind){	struct i2c_client *new_client;	struct lm92_data *data;	int err = 0;	char *name;	if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA					    | I2C_FUNC_SMBUS_WORD_DATA))		goto exit;	if (!(data = kmalloc(sizeof(struct lm92_data), GFP_KERNEL))) {		err = -ENOMEM;		goto exit;	}	memset(data, 0, sizeof(struct lm92_data));	/* Fill in enough client fields so that we can read from the chip,	   which is required for identication */	new_client = &data->client;	i2c_set_clientdata(new_client, data);	new_client->addr = address;	new_client->adapter = adapter;	new_client->driver = &lm92_driver;	new_client->flags = 0;	/* A negative kind means that the driver was loaded with no force	   parameter (default), so we must identify the chip. */	if (kind < 0) {		u8 config = i2c_smbus_read_byte_data(new_client,			     LM92_REG_CONFIG);		u16 man_id = i2c_smbus_read_word_data(new_client,			     LM92_REG_MAN_ID);		if ((config & 0xe0) == 0x00		 && man_id == 0x0180) {			pr_info("lm92: Found National Semiconductor LM92 chip\n");	 		kind = lm92;		} else		if (max6635_check(new_client)) {			pr_info("lm92: Found Maxim MAX6635 chip\n");			kind = lm92; /* No separate prefix */		}		else			goto exit_free;	} else	if (kind == 0) /* Default to an LM92 if forced */		kind = lm92;	/* Give it the proper name */	if (kind == lm92) {		name = "lm92";	} else { /* Supposedly cannot happen */		dev_dbg(&new_client->dev, "Kind out of range?\n");		goto exit_free;	}	/* Fill in the remaining client fields */	strlcpy(new_client->name, name, I2C_NAME_SIZE);	data->valid = 0;	init_MUTEX(&data->update_lock);	/* Tell the i2c subsystem a new client has arrived */	if ((err = i2c_attach_client(new_client)))		goto exit_free;	/* Initialize the chipset */	lm92_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(&new_client->dev, &dev_attr_temp1_input);	device_create_file(&new_client->dev, &dev_attr_temp1_crit);	device_create_file(&new_client->dev, &dev_attr_temp1_crit_hyst);	device_create_file(&new_client->dev, &dev_attr_temp1_min);	device_create_file(&new_client->dev, &dev_attr_temp1_min_hyst);	device_create_file(&new_client->dev, &dev_attr_temp1_max);	device_create_file(&new_client->dev, &dev_attr_temp1_max_hyst);	device_create_file(&new_client->dev, &dev_attr_alarms);	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/lm92.c/buggy/drivers/hwmon/lm92.c