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_temp1_max); 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, &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_temp2_min.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_temp2_crit.dev_attr); 
static int lm63_detect(struct i2c_adapter *adapter, int address, int kind){	struct i2c_client *new_client;	struct lm63_data *data;	int err = 0;	if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA))		goto exit;	if (!(data = kmalloc(sizeof(struct lm63_data), GFP_KERNEL))) {		err = -ENOMEM;		goto exit;	}	memset(data, 0, sizeof(struct lm63_data));	/* The common I2C client data is placed right before the	   LM63-specific data. */	new_client = &data->client;	i2c_set_clientdata(new_client, data);	new_client->addr = address;	new_client->adapter = adapter;	new_client->driver = &lm63_driver;	new_client->flags = 0;	/* Default to an LM63 if forced */	if (kind == 0)		kind = lm63;	if (kind < 0) { /* must identify */		u8 man_id, chip_id, reg_config1, reg_config2;		u8 reg_alert_status, reg_alert_mask;		man_id = i2c_smbus_read_byte_data(new_client,			 LM63_REG_MAN_ID);		chip_id = i2c_smbus_read_byte_data(new_client,			  LM63_REG_CHIP_ID);		reg_config1 = i2c_smbus_read_byte_data(new_client,			      LM63_REG_CONFIG1);		reg_config2 = i2c_smbus_read_byte_data(new_client,			      LM63_REG_CONFIG2);		reg_alert_status = i2c_smbus_read_byte_data(new_client,				   LM63_REG_ALERT_STATUS);		reg_alert_mask = i2c_smbus_read_byte_data(new_client,				 LM63_REG_ALERT_MASK);		if (man_id == 0x01 /* National Semiconductor */		 && chip_id == 0x41 /* LM63 */		 && (reg_config1 & 0x18) == 0x00		 && (reg_config2 & 0xF8) == 0x00		 && (reg_alert_status & 0x20) == 0x00		 && (reg_alert_mask & 0xA4) == 0xA4) {			kind = lm63;		} else { /* failed */			dev_dbg(&adapter->dev, "Unsupported chip "				"(man_id=0x%02X, chip_id=0x%02X).\n",				man_id, chip_id);			goto exit_free;		}	}	strlcpy(new_client->name, "lm63", 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 LM63 chip */	lm63_init_client(new_client);	/* Register sysfs hooks */	if (data->config & 0x04) { /* tachometer enabled */		device_create_file(&new_client->dev, &dev_attr_fan1_input);		device_create_file(&new_client->dev, &dev_attr_fan1_min);	}	device_create_file(&new_client->dev, &dev_attr_pwm1);	device_create_file(&new_client->dev, &dev_attr_pwm1_enable);	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_temp1_max);	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_free:	kfree(data);exit:	return err;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/bc51ae1159c0c9a34d2400a8449e1fca3ee965b4/lm63.c/clean/drivers/i2c/chips/lm63.c