struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr); int nr = sensor_attr->index;
static ssize_t set_temp_offset(struct device *dev, const char *buf,		size_t count, int nr){	struct i2c_client *client = to_i2c_client(dev);	struct adm1026_data *data = i2c_get_clientdata(client);	int val = simple_strtol(buf, NULL, 10);	down(&data->update_lock);	data->temp_offset[nr] = TEMP_TO_REG(val);	adm1026_write_value(client, ADM1026_REG_TEMP_OFFSET[nr],		data->temp_offset[nr]);	up(&data->update_lock);	return count;}