u8 man_id, chip_id; 
static int max1619_detect(struct i2c_adapter *adapter, int address, int kind){	struct i2c_client *new_client;	struct max1619_data *data;	int err = 0;	const char *name = "";		u8 reg_config=0, reg_convrate=0, reg_status=0;	u8 man_id, chip_id;	if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA))		goto exit;	if (!(data = kzalloc(sizeof(struct max1619_data), GFP_KERNEL))) {		err = -ENOMEM;		goto exit;	}	/* The common I2C client data is placed right before the	   MAX1619-specific data. */	new_client = &data->client;	i2c_set_clientdata(new_client, data);	new_client->addr = address;	new_client->adapter = adapter;	new_client->driver = &max1619_driver;	new_client->flags = 0;	/*	 * Now we do the remaining detection. A negative kind means that	 * the driver was loaded with no force parameter (default), so we	 * must both detect and identify the chip. 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.	 */	if (kind < 0) { /* detection */		reg_config = i2c_smbus_read_byte_data(new_client,			      MAX1619_REG_R_CONFIG);		reg_convrate = i2c_smbus_read_byte_data(new_client,			       MAX1619_REG_R_CONVRATE);		reg_status = i2c_smbus_read_byte_data(new_client,				MAX1619_REG_R_STATUS);		if ((reg_config & 0x03) != 0x00		 || reg_convrate > 0x07 || (reg_status & 0x61 ) !=0x00) {			dev_dbg(&adapter->dev,				"MAX1619 detection failed at 0x%02x.\n",				address);			goto exit_free;		}	}	if (kind <= 0) { /* identification */			man_id = i2c_smbus_read_byte_data(new_client,			 MAX1619_REG_R_MAN_ID);		chip_id = i2c_smbus_read_byte_data(new_client,			  MAX1619_REG_R_CHIP_ID);				if ((man_id == 0x4D) && (chip_id == 0x04)){  				kind = max1619;			}		}		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 == max1619){		name = "max1619";	}	/* 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 MAX1619 chip */	max1619_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_temp2_input);	device_create_file(&new_client->dev, &dev_attr_temp2_min);	device_create_file(&new_client->dev, &dev_attr_temp2_max);	device_create_file(&new_client->dev, &dev_attr_temp2_crit);	device_create_file(&new_client->dev, &dev_attr_temp2_crit_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/b0020e3f526cdbb2eb9408bc1b12171b3b91625b/max1619.c/buggy/drivers/hwmon/max1619.c