device_create_file(&new_client->dev, &dev_attr_in0_input); device_create_file(&new_client->dev, &dev_attr_in0_min); device_create_file(&new_client->dev, &dev_attr_in0_max); device_create_file(&new_client->dev, &dev_attr_in1_input); device_create_file(&new_client->dev, &dev_attr_in1_min); device_create_file(&new_client->dev, &dev_attr_in1_max); device_create_file(&new_client->dev, &dev_attr_in2_input); device_create_file(&new_client->dev, &dev_attr_in2_min); device_create_file(&new_client->dev, &dev_attr_in2_max); device_create_file(&new_client->dev, &dev_attr_in3_input); device_create_file(&new_client->dev, &dev_attr_in3_min); device_create_file(&new_client->dev, &dev_attr_in3_max); device_create_file(&new_client->dev, &dev_attr_in4_input); device_create_file(&new_client->dev, &dev_attr_in4_min); device_create_file(&new_client->dev, &dev_attr_in4_max); device_create_file(&new_client->dev, &dev_attr_in5_input); device_create_file(&new_client->dev, &dev_attr_in5_min); device_create_file(&new_client->dev, &dev_attr_in5_max); 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, &sensor_dev_attr_in0_input.dev_attr); device_create_file(&new_client->dev, &sensor_dev_attr_in0_min.dev_attr); device_create_file(&new_client->dev, &sensor_dev_attr_in0_max.dev_attr); device_create_file(&new_client->dev, &sensor_dev_attr_in1_input.dev_attr); device_create_file(&new_client->dev, &sensor_dev_attr_in1_min.dev_attr); device_create_file(&new_client->dev, &sensor_dev_attr_in1_max.dev_attr); device_create_file(&new_client->dev, &sensor_dev_attr_in2_input.dev_attr); device_create_file(&new_client->dev, &sensor_dev_attr_in2_min.dev_attr); device_create_file(&new_client->dev, &sensor_dev_attr_in2_max.dev_attr); device_create_file(&new_client->dev, &sensor_dev_attr_in3_input.dev_attr); device_create_file(&new_client->dev, &sensor_dev_attr_in3_min.dev_attr); device_create_file(&new_client->dev, &sensor_dev_attr_in3_max.dev_attr); device_create_file(&new_client->dev, &sensor_dev_attr_in4_input.dev_attr); device_create_file(&new_client->dev, &sensor_dev_attr_in4_min.dev_attr); device_create_file(&new_client->dev, &sensor_dev_attr_in4_max.dev_attr); device_create_file(&new_client->dev, &sensor_dev_attr_in5_input.dev_attr); device_create_file(&new_client->dev, &sensor_dev_attr_in5_min.dev_attr); device_create_file(&new_client->dev, &sensor_dev_attr_in5_max.dev_attr); 
static int adm9240_detect(struct i2c_adapter *adapter, int address, int kind){	struct i2c_client *new_client;	struct adm9240_data *data;	int err = 0;	const char *name = "";	u8 man_id, die_rev;	if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA))		goto exit;	if (!(data = kzalloc(sizeof(*data), GFP_KERNEL))) {		err = -ENOMEM;		goto exit;	}	new_client = &data->client;	i2c_set_clientdata(new_client, data);	new_client->addr = address;	new_client->adapter = adapter;	new_client->driver = &adm9240_driver;	new_client->flags = 0;	if (kind == 0) {		kind = adm9240;	}	if (kind < 0) {		/* verify chip: reg address should match i2c address */		if (i2c_smbus_read_byte_data(new_client, ADM9240_REG_I2C_ADDR)				!= address) {			dev_err(&adapter->dev, "detect fail: address match, "					"0x%02x\n", address);			goto exit_free;		}		/* check known chip manufacturer */		man_id = i2c_smbus_read_byte_data(new_client,				ADM9240_REG_MAN_ID);		if (man_id == 0x23) {			kind = adm9240;		} else if (man_id == 0xda) {			kind = ds1780;		} else if (man_id == 0x01) {			kind = lm81;		} else {			dev_err(&adapter->dev, "detect fail: unknown manuf, "					"0x%02x\n", man_id);			goto exit_free;		}		/* successful detect, print chip info */		die_rev = i2c_smbus_read_byte_data(new_client,				ADM9240_REG_DIE_REV);		dev_info(&adapter->dev, "found %s revision %u\n",				man_id == 0x23 ? "ADM9240" :				man_id == 0xda ? "DS1780" : "LM81", die_rev);	}	/* either forced or detected chip kind */	if (kind == adm9240) {		name = "adm9240";	} else if (kind == ds1780) {		name = "ds1780";	} else if (kind == lm81) {		name = "lm81";	}	/* fill in the remaining client fields and attach */	strlcpy(new_client->name, name, I2C_NAME_SIZE);	data->type = kind;	init_MUTEX(&data->update_lock);	if ((err = i2c_attach_client(new_client)))		goto exit_free;	adm9240_init_client(new_client);	/* populate sysfs filesystem */	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_in0_input);	device_create_file(&new_client->dev, &dev_attr_in0_min);	device_create_file(&new_client->dev, &dev_attr_in0_max);	device_create_file(&new_client->dev, &dev_attr_in1_input);	device_create_file(&new_client->dev, &dev_attr_in1_min);	device_create_file(&new_client->dev, &dev_attr_in1_max);	device_create_file(&new_client->dev, &dev_attr_in2_input);	device_create_file(&new_client->dev, &dev_attr_in2_min);	device_create_file(&new_client->dev, &dev_attr_in2_max);	device_create_file(&new_client->dev, &dev_attr_in3_input);	device_create_file(&new_client->dev, &dev_attr_in3_min);	device_create_file(&new_client->dev, &dev_attr_in3_max);	device_create_file(&new_client->dev, &dev_attr_in4_input);	device_create_file(&new_client->dev, &dev_attr_in4_min);	device_create_file(&new_client->dev, &dev_attr_in4_max);	device_create_file(&new_client->dev, &dev_attr_in5_input);	device_create_file(&new_client->dev, &dev_attr_in5_min);	device_create_file(&new_client->dev, &dev_attr_in5_max);	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_temp1_input);	device_create_file(&new_client->dev, &dev_attr_fan1_input);	device_create_file(&new_client->dev, &dev_attr_fan1_div);	device_create_file(&new_client->dev, &dev_attr_fan1_min);	device_create_file(&new_client->dev, &dev_attr_fan2_input);	device_create_file(&new_client->dev, &dev_attr_fan2_div);	device_create_file(&new_client->dev, &dev_attr_fan2_min);	device_create_file(&new_client->dev, &dev_attr_alarms);	device_create_file(&new_client->dev, &dev_attr_aout_output);	device_create_file(&new_client->dev, &dev_attr_chassis_clear);	device_create_file(&new_client->dev, &dev_attr_cpu0_vid);	return 0;exit_detach:	i2c_detach_client(new_client);exit_free:	kfree(data);exit:	return err;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/c7461a6652f40ce4f8e19d7368c7a807a618fb68/adm9240.c/clean/drivers/hwmon/adm9240.c