exit_detach: i2c_detach_client(new_client); 
static int lm83_detect(struct i2c_adapter *adapter, int address, int kind){	struct i2c_client *new_client;	struct lm83_data *data;	int err = 0;	const char *name = "";	if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA))		goto exit;	if (!(data = kmalloc(sizeof(struct lm83_data), GFP_KERNEL))) {		err = -ENOMEM;		goto exit;	}	memset(data, 0, sizeof(struct lm83_data));	/* The common I2C client data is placed right after the	 * LM83-specific data. */	new_client = &data->client;	i2c_set_clientdata(new_client, data);	new_client->addr = address;	new_client->adapter = adapter;	new_client->driver = &lm83_driver;	new_client->flags = 0;	/* Now we do the detection and identification. A negative kind	 * means that the driver was loaded with no force parameter	 * (default), so we must both detect and identify the chip	 * (actually there is only one possible kind of chip for now, LM83).	 * A zero kind means that the driver was loaded with the force	 * parameter, the detection step shall be skipped. A positive kind	 * means that the driver was loaded with the force parameter and a	 * given kind of chip is requested, so both the detection and the	 * identification steps are skipped. */	/* Default to an LM83 if forced */	if (kind == 0)		kind = lm83;	if (kind < 0) { /* detection */		if (((i2c_smbus_read_byte_data(new_client, LM83_REG_R_STATUS1)		    & 0xA8) != 0x00) ||		    ((i2c_smbus_read_byte_data(new_client, LM83_REG_R_STATUS2)		    & 0x48) != 0x00) ||		    ((i2c_smbus_read_byte_data(new_client, LM83_REG_R_CONFIG)		    & 0x41) != 0x00)) {			dev_dbg(&adapter->dev,			    "LM83 detection failed at 0x%02x.\n", address);			goto exit_free;		}	}	if (kind <= 0) { /* identification */		u8 man_id, chip_id;		man_id = i2c_smbus_read_byte_data(new_client,		    LM83_REG_R_MAN_ID);		chip_id = i2c_smbus_read_byte_data(new_client,		    LM83_REG_R_CHIP_ID);		if (man_id == 0x01) { /* National Semiconductor */			if (chip_id == 0x03) {				kind = lm83;			}		}		if (kind <= 0) { /* identification failed */			dev_info(&adapter->dev,			    "Unsupported chip (man_id=0x%02X, "			    "chip_id=0x%02X).\n", man_id, chip_id);			goto exit_free;		}	}	if (kind == lm83) {		name = "lm83";	}	/* We can 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 layer a new client has arrived */	if ((err = i2c_attach_client(new_client)))		goto exit_free;	/*	 * Initialize the LM83 chip	 * (Nothing to do for this one.)	 */	/* Register sysfs hooks */	device_create_file(&new_client->dev,			   &sensor_dev_attr_temp1_input.dev_attr);	device_create_file(&new_client->dev,			   &sensor_dev_attr_temp2_input.dev_attr);	device_create_file(&new_client->dev,			   &sensor_dev_attr_temp3_input.dev_attr);	device_create_file(&new_client->dev,			   &sensor_dev_attr_temp4_input.dev_attr);	device_create_file(&new_client->dev,			   &sensor_dev_attr_temp1_max.dev_attr);	device_create_file(&new_client->dev,			   &sensor_dev_attr_temp2_max.dev_attr);	device_create_file(&new_client->dev,			   &sensor_dev_attr_temp3_max.dev_attr);	device_create_file(&new_client->dev,			   &sensor_dev_attr_temp4_max.dev_attr);	device_create_file(&new_client->dev,			   &sensor_dev_attr_temp1_crit.dev_attr);	device_create_file(&new_client->dev,			   &sensor_dev_attr_temp2_crit.dev_attr);	device_create_file(&new_client->dev,			   &sensor_dev_attr_temp3_crit.dev_attr);	device_create_file(&new_client->dev,			   &sensor_dev_attr_temp4_crit.dev_attr);	device_create_file(&new_client->dev, &dev_attr_alarms);	return 0;exit_free:	kfree(data);exit:	return err;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/943b0830cebe4711354945ed3cb44e84152aaca0/lm83.c/clean/drivers/hwmon/lm83.c