diff for duplicates of <2538186705051703479bd0c29@mail.gmail.com> diff --git a/a/1.txt b/N1/1.txt index e2cc2de..5b1dfa6 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -11,19 +11,3 @@ applied, because I haven't got an adm1026 to test it with :-). Signed-off-by: Yani Ioannou <yani.ioannou@gmail.com> --- --------------- next part -------------- - drivers/i2c/chips/adm1026.c | 524 ++++++++++++++++++++------------------------ - include/linux/i2c-sysfs.h | 2 - 2 files changed, 242 insertions(+), 284 deletions(-) --------------- next part -------------- -A non-text attachment was scrubbed... -Name: patch-linux-2.6.12-rc4-sysfsdyncallback-deviceattr-i2c-adm1026.diff -Type: text/x-patch -Size: 41313 bytes -Desc: not available -Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20050517/00459ca1/patch-linux-2.6.12-rc4-sysfsdyncallback-deviceattr-i2c-adm1026.bin --------------- next part -------------- -_______________________________________________ -lm-sensors mailing list -lm-sensors@lm-sensors.org -http://lists.lm-sensors.org/mailman/listinfo/lm-sensors diff --git a/N1/2.hdr b/N1/2.hdr new file mode 100644 index 0000000..c74646a --- /dev/null +++ b/N1/2.hdr @@ -0,0 +1,4 @@ +Content-Type: text/plain; + name=patch-linux-2.6.12-rc4-sysfsdyncallback-deviceattr-i2c-adm1026.diff.diffstat.txt; charset=us-ascii +Content-Transfer-Encoding: 7bit +Content-Disposition: attachment; filename="patch-linux-2.6.12-rc4-sysfsdyncallback-deviceattr-i2c-adm1026.diff.diffstat.txt" diff --git a/N1/2.txt b/N1/2.txt new file mode 100644 index 0000000..300f905 --- /dev/null +++ b/N1/2.txt @@ -0,0 +1,3 @@ + drivers/i2c/chips/adm1026.c | 524 ++++++++++++++++++++------------------------ + include/linux/i2c-sysfs.h | 2 + 2 files changed, 242 insertions(+), 284 deletions(-) diff --git a/N1/3.hdr b/N1/3.hdr new file mode 100644 index 0000000..241574f --- /dev/null +++ b/N1/3.hdr @@ -0,0 +1,4 @@ +Content-Type: text/x-patch; + name=patch-linux-2.6.12-rc4-sysfsdyncallback-deviceattr-i2c-adm1026.diff; charset=us-ascii +Content-Transfer-Encoding: 7bit +Content-Disposition: attachment; filename="patch-linux-2.6.12-rc4-sysfsdyncallback-deviceattr-i2c-adm1026.diff" diff --git a/N1/3.txt b/N1/3.txt new file mode 100644 index 0000000..5b31ded --- /dev/null +++ b/N1/3.txt @@ -0,0 +1,758 @@ +diff -uprN -X dontdiff linux-2.6.12-rc4-sysfsdyncallback-deviceattr-i2c/drivers/i2c/chips/adm1026.c linux-2.6.12-rc4-sysfsdyncallback-deviceattr-i2c-adm1026/drivers/i2c/chips/adm1026.c +--- linux-2.6.12-rc4-sysfsdyncallback-deviceattr-i2c/drivers/i2c/chips/adm1026.c 2005-05-16 23:31:07.000000000 -0400 ++++ linux-2.6.12-rc4-sysfsdyncallback-deviceattr-i2c-adm1026/drivers/i2c/chips/adm1026.c 2005-05-17 02:28:55.000000000 -0400 +@@ -30,6 +30,7 @@ + #include <linux/jiffies.h> + #include <linux/i2c.h> + #include <linux/i2c-sensor.h> ++#include <linux/i2c-sysfs.h> + #include <linux/i2c-vid.h> + + /* Addresses to scan */ +@@ -711,19 +712,27 @@ static struct adm1026_data *adm1026_upda + return data; + } + +-static ssize_t show_in(struct device *dev, char *buf, int nr) ++static ssize_t show_in(struct device *dev, struct device_attribute *attr, ++ char *buf) + { ++ struct sensor_device_attribute *sensor_attr= to_sensor_dev_attr(attr); ++ int nr = sensor_attr->index; + struct adm1026_data *data = adm1026_update_device(dev); + return sprintf(buf,"%d\n", INS_FROM_REG(nr, data->in[nr])); + } +-static ssize_t show_in_min(struct device *dev, char *buf, int nr) ++static ssize_t show_in_min(struct device *dev, struct device_attribute *attr, ++ char *buf) + { ++ struct sensor_device_attribute *sensor_attr= to_sensor_dev_attr(attr); ++ int nr = sensor_attr->index; + struct adm1026_data *data = adm1026_update_device(dev); + return sprintf(buf,"%d\n", INS_FROM_REG(nr, data->in_min[nr])); + } +-static ssize_t set_in_min(struct device *dev, const char *buf, +- size_t count, int nr) ++static ssize_t set_in_min(struct device *dev, struct device_attribute *attr, ++ const char *buf, size_t count) + { ++ struct sensor_device_attribute *sensor_attr= to_sensor_dev_attr(attr); ++ int nr = sensor_attr->index; + struct i2c_client *client = to_i2c_client(dev); + struct adm1026_data *data = i2c_get_clientdata(client); + int val = simple_strtol(buf, NULL, 10); +@@ -734,14 +743,19 @@ static ssize_t set_in_min(struct device + up(&data->update_lock); + return count; + } +-static ssize_t show_in_max(struct device *dev, char *buf, int nr) ++static ssize_t show_in_max(struct device *dev, struct device_attribute *attr, ++ char *buf) + { ++ struct sensor_device_attribute *sensor_attr= to_sensor_dev_attr(attr); ++ int nr = sensor_attr->index; + struct adm1026_data *data = adm1026_update_device(dev); + return sprintf(buf,"%d\n", INS_FROM_REG(nr, data->in_max[nr])); + } +-static ssize_t set_in_max(struct device *dev, const char *buf, +- size_t count, int nr) ++static ssize_t set_in_max(struct device *dev, struct device_attribute *attr, ++ const char *buf, size_t count) + { ++ struct sensor_device_attribute *sensor_attr= to_sensor_dev_attr(attr); ++ int nr = sensor_attr->index; + struct i2c_client *client = to_i2c_client(dev); + struct adm1026_data *data = i2c_get_clientdata(client); + int val = simple_strtol(buf, NULL, 10); +@@ -753,34 +767,13 @@ static ssize_t set_in_max(struct device + return count; + } + +-#define in_reg(offset) \ +-static ssize_t show_in##offset (struct device *dev, struct device_attribute *attr, char *buf) \ +-{ \ +- return show_in(dev, buf, offset); \ +-} \ +-static ssize_t show_in##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \ +-{ \ +- return show_in_min(dev, buf, offset); \ +-} \ +-static ssize_t set_in##offset##_min (struct device *dev, struct device_attribute *attr, \ +- const char *buf, size_t count) \ +-{ \ +- return set_in_min(dev, buf, count, offset); \ +-} \ +-static ssize_t show_in##offset##_max (struct device *dev, struct device_attribute *attr, char *buf) \ +-{ \ +- return show_in_max(dev, buf, offset); \ +-} \ +-static ssize_t set_in##offset##_max (struct device *dev, struct device_attribute *attr, \ +- const char *buf, size_t count) \ +-{ \ +- return set_in_max(dev, buf, count, offset); \ +-} \ +-static DEVICE_ATTR(in##offset##_input, S_IRUGO, show_in##offset, NULL); \ +-static DEVICE_ATTR(in##offset##_min, S_IRUGO | S_IWUSR, \ +- show_in##offset##_min, set_in##offset##_min); \ +-static DEVICE_ATTR(in##offset##_max, S_IRUGO | S_IWUSR, \ +- show_in##offset##_max, set_in##offset##_max); ++#define in_reg(offset) \ ++static SENSOR_DEVICE_ATTR(in##offset##_input, S_IRUGO, show_in, \ ++ NULL, offset); \ ++static SENSOR_DEVICE_ATTR(in##offset##_min, S_IRUGO | S_IWUSR, \ ++ show_in_min, set_in_min, offset); \ ++static SENSOR_DEVICE_ATTR(in##offset##_max, S_IRUGO | S_IWUSR, \ ++ show_in_max, set_in_max, offset); + + + in_reg(0); +@@ -843,30 +836,38 @@ static ssize_t set_in16_max(struct devic + return count; + } + +-static DEVICE_ATTR(in16_input, S_IRUGO, show_in16, NULL); +-static DEVICE_ATTR(in16_min, S_IRUGO | S_IWUSR, show_in16_min, set_in16_min); +-static DEVICE_ATTR(in16_max, S_IRUGO | S_IWUSR, show_in16_max, set_in16_max); ++static SENSOR_DEVICE_ATTR(in16_input, S_IRUGO, show_in16, NULL, 16); ++static SENSOR_DEVICE_ATTR(in16_min, S_IRUGO | S_IWUSR, show_in16_min, set_in16_min, 16); ++static SENSOR_DEVICE_ATTR(in16_max, S_IRUGO | S_IWUSR, show_in16_max, set_in16_max, 16); + + + + + /* Now add fan read/write functions */ + +-static ssize_t show_fan(struct device *dev, char *buf, int nr) ++static ssize_t show_fan(struct device *dev, struct device_attribute *attr, ++ char *buf) + { ++ struct sensor_device_attribute *sensor_attr= to_sensor_dev_attr(attr); ++ int nr = sensor_attr->index; + struct adm1026_data *data = adm1026_update_device(dev); + return sprintf(buf,"%d\n", FAN_FROM_REG(data->fan[nr], + data->fan_div[nr])); + } +-static ssize_t show_fan_min(struct device *dev, char *buf, int nr) ++static ssize_t show_fan_min(struct device *dev, struct device_attribute *attr, ++ char *buf) + { ++ struct sensor_device_attribute *sensor_attr= to_sensor_dev_attr(attr); ++ int nr = sensor_attr->index; + struct adm1026_data *data = adm1026_update_device(dev); + return sprintf(buf,"%d\n", FAN_FROM_REG(data->fan_min[nr], + data->fan_div[nr])); + } +-static ssize_t set_fan_min(struct device *dev, const char *buf, +- size_t count, int nr) ++static ssize_t set_fan_min(struct device *dev, struct device_attribute *attr, ++ const char *buf, size_t count) + { ++ struct sensor_device_attribute *sensor_attr= to_sensor_dev_attr(attr); ++ int nr = sensor_attr->index; + struct i2c_client *client = to_i2c_client(dev); + struct adm1026_data *data = i2c_get_clientdata(client); + int val = simple_strtol(buf, NULL, 10); +@@ -879,23 +880,11 @@ static ssize_t set_fan_min(struct device + return count; + } + +-#define fan_offset(offset) \ +-static ssize_t show_fan_##offset (struct device *dev, struct device_attribute *attr, char *buf) \ +-{ \ +- return show_fan(dev, buf, offset - 1); \ +-} \ +-static ssize_t show_fan_##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \ +-{ \ +- return show_fan_min(dev, buf, offset - 1); \ +-} \ +-static ssize_t set_fan_##offset##_min (struct device *dev, struct device_attribute *attr, \ +- const char *buf, size_t count) \ +-{ \ +- return set_fan_min(dev, buf, count, offset - 1); \ +-} \ +-static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_fan_##offset, NULL); \ +-static DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR, \ +- show_fan_##offset##_min, set_fan_##offset##_min); ++#define fan_offset(offset) \ ++static SENSOR_DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_fan, NULL, \ ++ offset - 1); \ ++static SENSOR_DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR, \ ++ show_fan_min, set_fan_min, offset - 1); + + fan_offset(1); + fan_offset(2); +@@ -926,14 +915,19 @@ static void fixup_fan_min(struct device + } + + /* Now add fan_div read/write functions */ +-static ssize_t show_fan_div(struct device *dev, char *buf, int nr) ++static ssize_t show_fan_div(struct device *dev, struct device_attribute *attr, ++ char *buf) + { ++ struct sensor_device_attribute *sensor_attr= to_sensor_dev_attr(attr); ++ int nr = sensor_attr->index; + struct adm1026_data *data = adm1026_update_device(dev); + return sprintf(buf,"%d\n", data->fan_div[nr]); + } +-static ssize_t set_fan_div(struct device *dev, const char *buf, +- size_t count, int nr) ++static ssize_t set_fan_div(struct device *dev, struct device_attribute *attr, ++ const char *buf, size_t count) + { ++ struct sensor_device_attribute *sensor_attr= to_sensor_dev_attr(attr); ++ int nr = sensor_attr->index; + struct i2c_client *client = to_i2c_client(dev); + struct adm1026_data *data = i2c_get_clientdata(client); + int val,orig_div,new_div,shift; +@@ -967,17 +961,8 @@ static ssize_t set_fan_div(struct device + } + + #define fan_offset_div(offset) \ +-static ssize_t show_fan_##offset##_div (struct device *dev, struct device_attribute *attr, char *buf) \ +-{ \ +- return show_fan_div(dev, buf, offset - 1); \ +-} \ +-static ssize_t set_fan_##offset##_div (struct device *dev, struct device_attribute *attr, \ +- const char *buf, size_t count) \ +-{ \ +- return set_fan_div(dev, buf, count, offset - 1); \ +-} \ +-static DEVICE_ATTR(fan##offset##_div, S_IRUGO | S_IWUSR, \ +- show_fan_##offset##_div, set_fan_##offset##_div); ++static SENSOR_DEVICE_ATTR(fan##offset##_div, S_IRUGO | S_IWUSR, \ ++ show_fan_div, set_fan_div, offset - 1); + + fan_offset_div(1); + fan_offset_div(2); +@@ -989,19 +974,27 @@ fan_offset_div(7); + fan_offset_div(8); + + /* Temps */ +-static ssize_t show_temp(struct device *dev, char *buf, int nr) ++static ssize_t show_temp(struct device *dev, struct device_attribute *attr, ++ char *buf) + { ++ struct sensor_device_attribute *sensor_attr= to_sensor_dev_attr(attr); ++ int nr = sensor_attr->index; + struct adm1026_data *data = adm1026_update_device(dev); + return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp[nr])); + } +-static ssize_t show_temp_min(struct device *dev, char *buf, int nr) ++static ssize_t show_temp_min(struct device *dev, struct device_attribute *attr, ++ char *buf) + { ++ struct sensor_device_attribute *sensor_attr= to_sensor_dev_attr(attr); ++ int nr = sensor_attr->index; + struct adm1026_data *data = adm1026_update_device(dev); + return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp_min[nr])); + } +-static ssize_t set_temp_min(struct device *dev, const char *buf, +- size_t count, int nr) ++static ssize_t set_temp_min(struct device *dev, struct device_attribute *attr, ++ const char *buf, size_t count) + { ++ struct sensor_device_attribute *sensor_attr= to_sensor_dev_attr(attr); ++ int nr = sensor_attr->index; + struct i2c_client *client = to_i2c_client(dev); + struct adm1026_data *data = i2c_get_clientdata(client); + int val = simple_strtol(buf, NULL, 10); +@@ -1013,14 +1006,19 @@ static ssize_t set_temp_min(struct devic + up(&data->update_lock); + return count; + } +-static ssize_t show_temp_max(struct device *dev, char *buf, int nr) ++static ssize_t show_temp_max(struct device *dev, struct device_attribute *attr, ++ char *buf) + { ++ struct sensor_device_attribute *sensor_attr= to_sensor_dev_attr(attr); ++ int nr = sensor_attr->index; + struct adm1026_data *data = adm1026_update_device(dev); + return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp_max[nr])); + } +-static ssize_t set_temp_max(struct device *dev, const char *buf, +- size_t count, int nr) ++static ssize_t set_temp_max(struct device *dev, struct device_attribute *attr, ++ const char *buf, size_t count) + { ++ struct sensor_device_attribute *sensor_attr= to_sensor_dev_attr(attr); ++ int nr = sensor_attr->index; + struct i2c_client *client = to_i2c_client(dev); + struct adm1026_data *data = i2c_get_clientdata(client); + int val = simple_strtol(buf, NULL, 10); +@@ -1032,48 +1030,34 @@ static ssize_t set_temp_max(struct devic + up(&data->update_lock); + return count; + } +-#define temp_reg(offset) \ +-static ssize_t show_temp_##offset (struct device *dev, struct device_attribute *attr, char *buf) \ +-{ \ +- return show_temp(dev, buf, offset - 1); \ +-} \ +-static ssize_t show_temp_##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \ +-{ \ +- return show_temp_min(dev, buf, offset - 1); \ +-} \ +-static ssize_t show_temp_##offset##_max (struct device *dev, struct device_attribute *attr, char *buf) \ +-{ \ +- return show_temp_max(dev, buf, offset - 1); \ +-} \ +-static ssize_t set_temp_##offset##_min (struct device *dev, struct device_attribute *attr, \ +- const char *buf, size_t count) \ +-{ \ +- return set_temp_min(dev, buf, count, offset - 1); \ +-} \ +-static ssize_t set_temp_##offset##_max (struct device *dev, struct device_attribute *attr, \ +- const char *buf, size_t count) \ +-{ \ +- return set_temp_max(dev, buf, count, offset - 1); \ +-} \ +-static DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_temp_##offset, NULL); \ +-static DEVICE_ATTR(temp##offset##_min, S_IRUGO | S_IWUSR, \ +- show_temp_##offset##_min, set_temp_##offset##_min); \ +-static DEVICE_ATTR(temp##offset##_max, S_IRUGO | S_IWUSR, \ +- show_temp_##offset##_max, set_temp_##offset##_max); ++ ++#define temp_reg(offset) \ ++static SENSOR_DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_temp, \ ++ NULL, offset - 1); \ ++static SENSOR_DEVICE_ATTR(temp##offset##_min, S_IRUGO | S_IWUSR, \ ++ show_temp_min, set_temp_min, offset - 1); \ ++static SENSOR_DEVICE_ATTR(temp##offset##_max, S_IRUGO | S_IWUSR, \ ++ show_temp_max, set_temp_max, offset - 1); + + + temp_reg(1); + temp_reg(2); + temp_reg(3); + +-static ssize_t show_temp_offset(struct device *dev, char *buf, int nr) ++static ssize_t show_temp_offset(struct device *dev, ++ struct device_attribute *attr, char *buf) + { ++ struct sensor_device_attribute *sensor_attr= to_sensor_dev_attr(attr); ++ int nr = sensor_attr->index; + struct adm1026_data *data = adm1026_update_device(dev); + return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp_offset[nr])); + } +-static ssize_t set_temp_offset(struct device *dev, const char *buf, +- size_t count, int nr) ++static ssize_t set_temp_offset(struct device *dev, ++ struct device_attribute *attr, const char *buf, ++ size_t count) + { ++ struct sensor_device_attribute *sensor_attr= to_sensor_dev_attr(attr); ++ int nr = sensor_attr->index; + struct i2c_client *client = to_i2c_client(dev); + struct adm1026_data *data = i2c_get_clientdata(client); + int val = simple_strtol(buf, NULL, 10); +@@ -1086,46 +1070,45 @@ static ssize_t set_temp_offset(struct de + return count; + } + +-#define temp_offset_reg(offset) \ +-static ssize_t show_temp_##offset##_offset (struct device *dev, struct device_attribute *attr, char *buf) \ +-{ \ +- return show_temp_offset(dev, buf, offset - 1); \ +-} \ +-static ssize_t set_temp_##offset##_offset (struct device *dev, struct device_attribute *attr, \ +- const char *buf, size_t count) \ +-{ \ +- return set_temp_offset(dev, buf, count, offset - 1); \ +-} \ +-static DEVICE_ATTR(temp##offset##_offset, S_IRUGO | S_IWUSR, \ +- show_temp_##offset##_offset, set_temp_##offset##_offset); ++#define temp_offset_reg(offset) \ ++static SENSOR_DEVICE_ATTR(temp##offset##_offset, S_IRUGO | S_IWUSR, \ ++ show_temp_offset, set_temp_offset, offset - 1); + + temp_offset_reg(1); + temp_offset_reg(2); + temp_offset_reg(3); + +-static ssize_t show_temp_auto_point1_temp_hyst(struct device *dev, char *buf, +- int nr) ++static ssize_t show_temp_auto_point1_temp_hyst(struct device *dev, ++ struct device_attribute *attr, char *buf) + { ++ struct sensor_device_attribute *sensor_attr= to_sensor_dev_attr(attr); ++ int nr = sensor_attr->index; + struct adm1026_data *data = adm1026_update_device(dev); + return sprintf(buf,"%d\n", TEMP_FROM_REG( + ADM1026_FAN_ACTIVATION_TEMP_HYST + data->temp_tmin[nr])); + } +-static ssize_t show_temp_auto_point2_temp(struct device *dev, char *buf, +- int nr) ++static ssize_t show_temp_auto_point2_temp(struct device *dev, ++ struct device_attribute *attr, char *buf) + { ++ struct sensor_device_attribute *sensor_attr= to_sensor_dev_attr(attr); ++ int nr = sensor_attr->index; + struct adm1026_data *data = adm1026_update_device(dev); + return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp_tmin[nr] + + ADM1026_FAN_CONTROL_TEMP_RANGE)); + } +-static ssize_t show_temp_auto_point1_temp(struct device *dev, char *buf, +- int nr) ++static ssize_t show_temp_auto_point1_temp(struct device *dev, ++ struct device_attribute *attr, char *buf) + { ++ struct sensor_device_attribute *sensor_attr= to_sensor_dev_attr(attr); ++ int nr = sensor_attr->index; + struct adm1026_data *data = adm1026_update_device(dev); + return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp_tmin[nr])); + } +-static ssize_t set_temp_auto_point1_temp(struct device *dev, const char *buf, +- size_t count, int nr) ++static ssize_t set_temp_auto_point1_temp(struct device *dev, ++ struct device_attribute *attr, const char *buf, size_t count) + { ++ struct sensor_device_attribute *sensor_attr= to_sensor_dev_attr(attr); ++ int nr = sensor_attr->index; + struct i2c_client *client = to_i2c_client(dev); + struct adm1026_data *data = i2c_get_clientdata(client); + int val = simple_strtol(buf, NULL, 10); +@@ -1138,46 +1121,27 @@ static ssize_t set_temp_auto_point1_temp + return count; + } + +-#define temp_auto_point(offset) \ +-static ssize_t show_temp##offset##_auto_point1_temp (struct device *dev, struct device_attribute *attr, \ +- char *buf) \ +-{ \ +- return show_temp_auto_point1_temp(dev, buf, offset - 1); \ +-} \ +-static ssize_t set_temp##offset##_auto_point1_temp (struct device *dev, struct device_attribute *attr, \ +- const char *buf, size_t count) \ +-{ \ +- return set_temp_auto_point1_temp(dev, buf, count, offset - 1); \ +-} \ +-static ssize_t show_temp##offset##_auto_point1_temp_hyst (struct device \ +- *dev, struct device_attribute *attr, char *buf) \ +-{ \ +- return show_temp_auto_point1_temp_hyst(dev, buf, offset - 1); \ +-} \ +-static ssize_t show_temp##offset##_auto_point2_temp (struct device *dev, struct device_attribute *attr, \ +- char *buf) \ +-{ \ +- return show_temp_auto_point2_temp(dev, buf, offset - 1); \ +-} \ +-static DEVICE_ATTR(temp##offset##_auto_point1_temp, S_IRUGO | S_IWUSR, \ +- show_temp##offset##_auto_point1_temp, \ +- set_temp##offset##_auto_point1_temp); \ +-static DEVICE_ATTR(temp##offset##_auto_point1_temp_hyst, S_IRUGO, \ +- show_temp##offset##_auto_point1_temp_hyst, NULL); \ +-static DEVICE_ATTR(temp##offset##_auto_point2_temp, S_IRUGO, \ +- show_temp##offset##_auto_point2_temp, NULL); ++#define temp_auto_point(offset) \ ++static SENSOR_DEVICE_ATTR(temp##offset##_auto_point1_temp, S_IRUGO | S_IWUSR, \ ++ show_temp_auto_point1_temp, set_temp_auto_point1_temp, \ ++ offset - 1); \ ++static SENSOR_DEVICE_ATTR(temp##offset##_auto_point1_temp_hyst, S_IRUGO, \ ++ show_temp_auto_point1_temp_hyst, NULL, offset - 1); \ ++static SENSOR_DEVICE_ATTR(temp##offset##_auto_point2_temp, S_IRUGO, \ ++ show_temp_auto_point2_temp, NULL, offset - 1); + + temp_auto_point(1); + temp_auto_point(2); + temp_auto_point(3); + +-static ssize_t show_temp_crit_enable(struct device *dev, struct device_attribute *attr, char *buf) ++static ssize_t show_temp_crit_enable(struct device *dev, ++ struct device_attribute *attr, char *buf) + { + struct adm1026_data *data = adm1026_update_device(dev); + return sprintf(buf,"%d\n", (data->config1 & CFG1_THERM_HOT) >> 4); + } +-static ssize_t set_temp_crit_enable(struct device *dev, struct device_attribute *attr, const char *buf, +- size_t count) ++static ssize_t set_temp_crit_enable(struct device *dev, ++ struct device_attribute *attr, const char *buf, size_t count) + { + struct i2c_client *client = to_i2c_client(dev); + struct adm1026_data *data = i2c_get_clientdata(client); +@@ -1193,24 +1157,27 @@ static ssize_t set_temp_crit_enable(stru + return count; + } + +-static DEVICE_ATTR(temp1_crit_enable, S_IRUGO | S_IWUSR, +- show_temp_crit_enable, set_temp_crit_enable); +- +-static DEVICE_ATTR(temp2_crit_enable, S_IRUGO | S_IWUSR, +- show_temp_crit_enable, set_temp_crit_enable); +- +-static DEVICE_ATTR(temp3_crit_enable, S_IRUGO | S_IWUSR, ++#define temp_crit_enable(offset) \ ++static DEVICE_ATTR(temp##offset##_crit_enable, S_IRUGO | S_IWUSR, \ + show_temp_crit_enable, set_temp_crit_enable); + ++temp_crit_enable(1); ++temp_crit_enable(2); ++temp_crit_enable(3); + +-static ssize_t show_temp_crit(struct device *dev, char *buf, int nr) ++static ssize_t show_temp_crit(struct device *dev, ++ struct device_attribute *attr, char *buf) + { ++ struct sensor_device_attribute *sensor_attr= to_sensor_dev_attr(attr); ++ int nr = sensor_attr->index; + struct adm1026_data *data = adm1026_update_device(dev); + return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp_crit[nr])); + } +-static ssize_t set_temp_crit(struct device *dev, const char *buf, +- size_t count, int nr) ++static ssize_t set_temp_crit(struct device *dev, struct device_attribute *attr, ++ const char *buf, size_t count) + { ++ struct sensor_device_attribute *sensor_attr= to_sensor_dev_attr(attr); ++ int nr = sensor_attr->index; + struct i2c_client *client = to_i2c_client(dev); + struct adm1026_data *data = i2c_get_clientdata(client); + int val = simple_strtol(buf, NULL, 10); +@@ -1223,18 +1190,9 @@ static ssize_t set_temp_crit(struct devi + return count; + } + +-#define temp_crit_reg(offset) \ +-static ssize_t show_temp_##offset##_crit (struct device *dev, struct device_attribute *attr, char *buf) \ +-{ \ +- return show_temp_crit(dev, buf, offset - 1); \ +-} \ +-static ssize_t set_temp_##offset##_crit (struct device *dev, struct device_attribute *attr, \ +- const char *buf, size_t count) \ +-{ \ +- return set_temp_crit(dev, buf, count, offset - 1); \ +-} \ +-static DEVICE_ATTR(temp##offset##_crit, S_IRUGO | S_IWUSR, \ +- show_temp_##offset##_crit, set_temp_##offset##_crit); ++#define temp_crit_reg(offset) \ ++static SENSOR_DEVICE_ATTR(temp##offset##_crit, S_IRUGO | S_IWUSR, \ ++ show_temp_crit, set_temp_crit, offset - 1); + + temp_crit_reg(1); + temp_crit_reg(2); +@@ -1597,114 +1555,114 @@ int adm1026_detect(struct i2c_adapter *a + adm1026_init_client(new_client); + + /* Register sysfs hooks */ +- device_create_file(&new_client->dev, &dev_attr_in0_input); +- device_create_file(&new_client->dev, &dev_attr_in0_max); +- device_create_file(&new_client->dev, &dev_attr_in0_min); +- device_create_file(&new_client->dev, &dev_attr_in1_input); +- device_create_file(&new_client->dev, &dev_attr_in1_max); +- device_create_file(&new_client->dev, &dev_attr_in1_min); +- device_create_file(&new_client->dev, &dev_attr_in2_input); +- device_create_file(&new_client->dev, &dev_attr_in2_max); +- device_create_file(&new_client->dev, &dev_attr_in2_min); +- device_create_file(&new_client->dev, &dev_attr_in3_input); +- device_create_file(&new_client->dev, &dev_attr_in3_max); +- device_create_file(&new_client->dev, &dev_attr_in3_min); +- device_create_file(&new_client->dev, &dev_attr_in4_input); +- device_create_file(&new_client->dev, &dev_attr_in4_max); +- device_create_file(&new_client->dev, &dev_attr_in4_min); +- device_create_file(&new_client->dev, &dev_attr_in5_input); +- device_create_file(&new_client->dev, &dev_attr_in5_max); +- device_create_file(&new_client->dev, &dev_attr_in5_min); +- device_create_file(&new_client->dev, &dev_attr_in6_input); +- device_create_file(&new_client->dev, &dev_attr_in6_max); +- device_create_file(&new_client->dev, &dev_attr_in6_min); +- device_create_file(&new_client->dev, &dev_attr_in7_input); +- device_create_file(&new_client->dev, &dev_attr_in7_max); +- device_create_file(&new_client->dev, &dev_attr_in7_min); +- device_create_file(&new_client->dev, &dev_attr_in8_input); +- device_create_file(&new_client->dev, &dev_attr_in8_max); +- device_create_file(&new_client->dev, &dev_attr_in8_min); +- device_create_file(&new_client->dev, &dev_attr_in9_input); +- device_create_file(&new_client->dev, &dev_attr_in9_max); +- device_create_file(&new_client->dev, &dev_attr_in9_min); +- device_create_file(&new_client->dev, &dev_attr_in10_input); +- device_create_file(&new_client->dev, &dev_attr_in10_max); +- device_create_file(&new_client->dev, &dev_attr_in10_min); +- device_create_file(&new_client->dev, &dev_attr_in11_input); +- device_create_file(&new_client->dev, &dev_attr_in11_max); +- device_create_file(&new_client->dev, &dev_attr_in11_min); +- device_create_file(&new_client->dev, &dev_attr_in12_input); +- device_create_file(&new_client->dev, &dev_attr_in12_max); +- device_create_file(&new_client->dev, &dev_attr_in12_min); +- device_create_file(&new_client->dev, &dev_attr_in13_input); +- device_create_file(&new_client->dev, &dev_attr_in13_max); +- device_create_file(&new_client->dev, &dev_attr_in13_min); +- device_create_file(&new_client->dev, &dev_attr_in14_input); +- device_create_file(&new_client->dev, &dev_attr_in14_max); +- device_create_file(&new_client->dev, &dev_attr_in14_min); +- device_create_file(&new_client->dev, &dev_attr_in15_input); +- device_create_file(&new_client->dev, &dev_attr_in15_max); +- device_create_file(&new_client->dev, &dev_attr_in15_min); +- device_create_file(&new_client->dev, &dev_attr_in16_input); +- device_create_file(&new_client->dev, &dev_attr_in16_max); +- device_create_file(&new_client->dev, &dev_attr_in16_min); +- 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_fan3_input); +- device_create_file(&new_client->dev, &dev_attr_fan3_div); +- device_create_file(&new_client->dev, &dev_attr_fan3_min); +- device_create_file(&new_client->dev, &dev_attr_fan4_input); +- device_create_file(&new_client->dev, &dev_attr_fan4_div); +- device_create_file(&new_client->dev, &dev_attr_fan4_min); +- device_create_file(&new_client->dev, &dev_attr_fan5_input); +- device_create_file(&new_client->dev, &dev_attr_fan5_div); +- device_create_file(&new_client->dev, &dev_attr_fan5_min); +- device_create_file(&new_client->dev, &dev_attr_fan6_input); +- device_create_file(&new_client->dev, &dev_attr_fan6_div); +- device_create_file(&new_client->dev, &dev_attr_fan6_min); +- device_create_file(&new_client->dev, &dev_attr_fan7_input); +- device_create_file(&new_client->dev, &dev_attr_fan7_div); +- device_create_file(&new_client->dev, &dev_attr_fan7_min); +- device_create_file(&new_client->dev, &dev_attr_fan8_input); +- device_create_file(&new_client->dev, &dev_attr_fan8_div); +- device_create_file(&new_client->dev, &dev_attr_fan8_min); +- device_create_file(&new_client->dev, &dev_attr_temp1_input); +- device_create_file(&new_client->dev, &dev_attr_temp1_max); +- device_create_file(&new_client->dev, &dev_attr_temp1_min); +- device_create_file(&new_client->dev, &dev_attr_temp2_input); +- device_create_file(&new_client->dev, &dev_attr_temp2_max); +- device_create_file(&new_client->dev, &dev_attr_temp2_min); +- device_create_file(&new_client->dev, &dev_attr_temp3_input); +- device_create_file(&new_client->dev, &dev_attr_temp3_max); +- device_create_file(&new_client->dev, &dev_attr_temp3_min); +- device_create_file(&new_client->dev, &dev_attr_temp1_offset); +- device_create_file(&new_client->dev, &dev_attr_temp2_offset); +- device_create_file(&new_client->dev, &dev_attr_temp3_offset); ++ device_create_file(&new_client->dev, &sensor_dev_attr_in0_input.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_in0_max.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_in0_min.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_max.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_in1_min.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_max.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_in2_min.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_max.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_in3_min.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_max.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_in4_min.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_max.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_in5_min.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_in6_input.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_in6_max.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_in6_min.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_in7_input.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_in7_max.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_in7_min.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_in8_input.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_in8_max.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_in8_min.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_in9_input.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_in9_max.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_in9_min.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_in10_input.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_in10_max.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_in10_min.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_in11_input.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_in11_max.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_in11_min.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_in12_input.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_in12_max.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_in12_min.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_in13_input.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_in13_max.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_in13_min.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_in14_input.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_in14_max.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_in14_min.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_in15_input.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_in15_max.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_in15_min.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_in16_input.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_in16_max.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_in16_min.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_fan1_input.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_fan1_div.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_fan1_min.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_fan2_input.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_fan2_div.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_fan2_min.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_fan3_input.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_fan3_div.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_fan3_min.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_fan4_input.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_fan4_div.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_fan4_min.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_fan5_input.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_fan5_div.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_fan5_min.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_fan6_input.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_fan6_div.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_fan6_min.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_fan7_input.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_fan7_div.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_fan7_min.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_fan8_input.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_fan8_div.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_fan8_min.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_temp1_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_temp1_min.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_max.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_temp2_min.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_temp3_input.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_temp3_max.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_temp3_min.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_temp1_offset.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_temp2_offset.dev_attr); ++ device_create_file(&new_client->dev, &sensor_dev_attr_temp3_offset.dev_attr); + device_create_file(&new_client->dev, +- &dev_attr_temp1_auto_point1_temp); ++ &sensor_dev_attr_temp1_auto_point1_temp.dev_attr); + device_create_file(&new_client->dev, +- &dev_attr_temp2_auto_point1_temp); ++ &sensor_dev_attr_temp2_auto_point1_temp.dev_attr); + device_create_file(&new_client->dev, +- &dev_attr_temp3_auto_point1_temp); ++ &sensor_dev_attr_temp3_auto_point1_temp.dev_attr); + device_create_file(&new_client->dev, +- &dev_attr_temp1_auto_point1_temp_hyst); ++ &sensor_dev_attr_temp1_auto_point1_temp_hyst.dev_attr); + device_create_file(&new_client->dev, +- &dev_attr_temp2_auto_point1_temp_hyst); ++ &sensor_dev_attr_temp2_auto_point1_temp_hyst.dev_attr); + device_create_file(&new_client->dev, +- &dev_attr_temp3_auto_point1_temp_hyst); ++ &sensor_dev_attr_temp3_auto_point1_temp_hyst.dev_attr); + device_create_file(&new_client->dev, +- &dev_attr_temp1_auto_point2_temp); ++ &sensor_dev_attr_temp1_auto_point2_temp.dev_attr); + device_create_file(&new_client->dev, +- &dev_attr_temp2_auto_point2_temp); ++ &sensor_dev_attr_temp2_auto_point2_temp.dev_attr); + device_create_file(&new_client->dev, +- &dev_attr_temp3_auto_point2_temp); +- device_create_file(&new_client->dev, &dev_attr_temp1_crit); +- device_create_file(&new_client->dev, &dev_attr_temp2_crit); +- device_create_file(&new_client->dev, &dev_attr_temp3_crit); ++ &sensor_dev_attr_temp3_auto_point2_temp.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, &dev_attr_temp1_crit_enable); + device_create_file(&new_client->dev, &dev_attr_temp2_crit_enable); + device_create_file(&new_client->dev, &dev_attr_temp3_crit_enable); +diff -uprN -X dontdiff linux-2.6.12-rc4-sysfsdyncallback-deviceattr-i2c/include/linux/i2c-sysfs.h linux-2.6.12-rc4-sysfsdyncallback-deviceattr-i2c-adm1026/include/linux/i2c-sysfs.h +--- linux-2.6.12-rc4-sysfsdyncallback-deviceattr-i2c/include/linux/i2c-sysfs.h 2005-05-16 23:30:12.000000000 -0400 ++++ linux-2.6.12-rc4-sysfsdyncallback-deviceattr-i2c-adm1026/include/linux/i2c-sysfs.h 2005-05-17 02:11:39.000000000 -0400 +@@ -31,7 +31,7 @@ container_of(_dev_attr, struct sensor_de + #define SENSOR_DEVICE_ATTR(_name,_mode,_show,_store,_index) \ + struct sensor_device_attribute sensor_dev_attr_##_name = { \ + .dev_attr=__ATTR(_name,_mode,_show,_store), \ +- .index_index, \ ++ .index=_index, \ + } + + #endif /* _LINUX_I2C_SYSFS_H */ diff --git a/a/content_digest b/N1/content_digest index cb062d4..c341faa 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -1,10 +1,10 @@ - "From\0yani.ioannou@gmail.com (Yani Ioannou)\0" - "Subject\0[lm-sensors] [PATCH 2.6.12-rc4 15/15] drivers/i2c/chips/adm1026.c:\0" - "Date\0Thu, 19 May 2005 06:25:59 +0000\0" + "From\0Yani Ioannou <yani.ioannou@gmail.com>\0" + "Subject\0[PATCH 2.6.12-rc4 15/15] drivers/i2c/chips/adm1026.c: use dynamic sysfs callbacks\0" + "Date\0Tue, 17 May 2005 06:47:24 -0400\0" "To\0Greg KH <greg@kroah.com>" linux-kernel@vger.kernel.org " lm-sensors@lm-sensors.org\0" - "\00:1\0" + "\01:1\0" "b\0" "Finally (phew!) this patch demonstrates how to adapt the adm1026 to\n" "take advantage of the new callbacks, and the i2c-sysfs.h defined\n" @@ -18,22 +18,773 @@ "\n" "Signed-off-by: Yani Ioannou <yani.ioannou@gmail.com>\n" "\n" - "---\n" - "-------------- next part --------------\n" + --- + "\01:2\0" + "fn\0patch-linux-2.6.12-rc4-sysfsdyncallback-deviceattr-i2c-adm1026.diff.diffstat.txt\0" + "b\0" " drivers/i2c/chips/adm1026.c | 524 ++++++++++++++++++++------------------------\n" " include/linux/i2c-sysfs.h | 2 \n" - " 2 files changed, 242 insertions(+), 284 deletions(-)\n" - "-------------- next part --------------\n" - "A non-text attachment was scrubbed...\n" - "Name: patch-linux-2.6.12-rc4-sysfsdyncallback-deviceattr-i2c-adm1026.diff\n" - "Type: text/x-patch\n" - "Size: 41313 bytes\n" - "Desc: not available\n" - "Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20050517/00459ca1/patch-linux-2.6.12-rc4-sysfsdyncallback-deviceattr-i2c-adm1026.bin\n" - "-------------- next part --------------\n" - "_______________________________________________\n" - "lm-sensors mailing list\n" - "lm-sensors@lm-sensors.org\n" - http://lists.lm-sensors.org/mailman/listinfo/lm-sensors + 2 files changed, 242 insertions(+), 284 deletions(-) + "\01:3\0" + "fn\0patch-linux-2.6.12-rc4-sysfsdyncallback-deviceattr-i2c-adm1026.diff\0" + "b\0" + "diff -uprN -X dontdiff linux-2.6.12-rc4-sysfsdyncallback-deviceattr-i2c/drivers/i2c/chips/adm1026.c linux-2.6.12-rc4-sysfsdyncallback-deviceattr-i2c-adm1026/drivers/i2c/chips/adm1026.c\n" + "--- linux-2.6.12-rc4-sysfsdyncallback-deviceattr-i2c/drivers/i2c/chips/adm1026.c\t2005-05-16 23:31:07.000000000 -0400\n" + "+++ linux-2.6.12-rc4-sysfsdyncallback-deviceattr-i2c-adm1026/drivers/i2c/chips/adm1026.c\t2005-05-17 02:28:55.000000000 -0400\n" + "@@ -30,6 +30,7 @@\n" + " #include <linux/jiffies.h>\n" + " #include <linux/i2c.h>\n" + " #include <linux/i2c-sensor.h>\n" + "+#include <linux/i2c-sysfs.h>\n" + " #include <linux/i2c-vid.h>\n" + " \n" + " /* Addresses to scan */\n" + "@@ -711,19 +712,27 @@ static struct adm1026_data *adm1026_upda\n" + " \treturn data;\n" + " }\n" + " \n" + "-static ssize_t show_in(struct device *dev, char *buf, int nr)\n" + "+static ssize_t show_in(struct device *dev, struct device_attribute *attr,\n" + "+\t\tchar *buf)\n" + " {\n" + "+\tstruct sensor_device_attribute *sensor_attr= to_sensor_dev_attr(attr);\n" + "+\tint nr = sensor_attr->index;\n" + " \tstruct adm1026_data *data = adm1026_update_device(dev);\n" + " \treturn sprintf(buf,\"%d\\n\", INS_FROM_REG(nr, data->in[nr]));\n" + " }\n" + "-static ssize_t show_in_min(struct device *dev, char *buf, int nr) \n" + "+static ssize_t show_in_min(struct device *dev, struct device_attribute *attr,\n" + "+\t\tchar *buf) \n" + " {\n" + "+\tstruct sensor_device_attribute *sensor_attr= to_sensor_dev_attr(attr);\n" + "+\tint nr = sensor_attr->index;\n" + " \tstruct adm1026_data *data = adm1026_update_device(dev); \n" + " \treturn sprintf(buf,\"%d\\n\", INS_FROM_REG(nr, data->in_min[nr]));\n" + " }\n" + "-static ssize_t set_in_min(struct device *dev, const char *buf, \n" + "-\t\tsize_t count, int nr)\n" + "+static ssize_t set_in_min(struct device *dev, struct device_attribute *attr,\n" + "+\t\tconst char *buf, size_t count)\n" + " {\n" + "+\tstruct sensor_device_attribute *sensor_attr= to_sensor_dev_attr(attr);\n" + "+\tint nr = sensor_attr->index;\n" + " \tstruct i2c_client *client = to_i2c_client(dev);\n" + " \tstruct adm1026_data *data = i2c_get_clientdata(client);\n" + " \tint val = simple_strtol(buf, NULL, 10);\n" + "@@ -734,14 +743,19 @@ static ssize_t set_in_min(struct device \n" + " \tup(&data->update_lock);\n" + " \treturn count; \n" + " }\n" + "-static ssize_t show_in_max(struct device *dev, char *buf, int nr)\n" + "+static ssize_t show_in_max(struct device *dev, struct device_attribute *attr,\n" + "+\t\tchar *buf)\n" + " {\n" + "+\tstruct sensor_device_attribute *sensor_attr= to_sensor_dev_attr(attr);\n" + "+\tint nr = sensor_attr->index;\n" + " \tstruct adm1026_data *data = adm1026_update_device(dev);\n" + " \treturn sprintf(buf,\"%d\\n\", INS_FROM_REG(nr, data->in_max[nr]));\n" + " }\n" + "-static ssize_t set_in_max(struct device *dev, const char *buf,\n" + "-\t\tsize_t count, int nr)\n" + "+static ssize_t set_in_max(struct device *dev, struct device_attribute *attr,\n" + "+\t\tconst char *buf, size_t count)\n" + " {\n" + "+\tstruct sensor_device_attribute *sensor_attr= to_sensor_dev_attr(attr);\n" + "+\tint nr = sensor_attr->index;\n" + " \tstruct i2c_client *client = to_i2c_client(dev);\n" + " \tstruct adm1026_data *data = i2c_get_clientdata(client);\n" + " \tint val = simple_strtol(buf, NULL, 10);\n" + "@@ -753,34 +767,13 @@ static ssize_t set_in_max(struct device \n" + " \treturn count;\n" + " }\n" + " \n" + "-#define in_reg(offset) \\\n" + "-static ssize_t show_in##offset (struct device *dev, struct device_attribute *attr, char *buf) \\\n" + "-{ \\\n" + "-\treturn show_in(dev, buf, offset); \\\n" + "-} \\\n" + "-static ssize_t show_in##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \\\n" + "-{ \\\n" + "-\treturn show_in_min(dev, buf, offset); \\\n" + "-} \\\n" + "-static ssize_t set_in##offset##_min (struct device *dev, struct device_attribute *attr, \\\n" + "-\tconst char *buf, size_t count) \\\n" + "-{ \\\n" + "-\treturn set_in_min(dev, buf, count, offset); \\\n" + "-} \\\n" + "-static ssize_t show_in##offset##_max (struct device *dev, struct device_attribute *attr, char *buf) \\\n" + "-{ \\\n" + "-\treturn show_in_max(dev, buf, offset); \\\n" + "-} \\\n" + "-static ssize_t set_in##offset##_max (struct device *dev, struct device_attribute *attr, \\\n" + "-\tconst char *buf, size_t count) \\\n" + "-{ \\\n" + "-\treturn set_in_max(dev, buf, count, offset); \\\n" + "-} \\\n" + "-static DEVICE_ATTR(in##offset##_input, S_IRUGO, show_in##offset, NULL); \\\n" + "-static DEVICE_ATTR(in##offset##_min, S_IRUGO | S_IWUSR, \\\n" + "-\t\tshow_in##offset##_min, set_in##offset##_min); \\\n" + "-static DEVICE_ATTR(in##offset##_max, S_IRUGO | S_IWUSR, \\\n" + "-\t\tshow_in##offset##_max, set_in##offset##_max);\n" + "+#define in_reg(offset)\t\t\t\t\t\t\\\n" + "+static SENSOR_DEVICE_ATTR(in##offset##_input, S_IRUGO, show_in,\t\\\n" + "+\t\tNULL, offset);\t\t\t\t\t\\\n" + "+static SENSOR_DEVICE_ATTR(in##offset##_min, S_IRUGO | S_IWUSR,\t\\\n" + "+\t\tshow_in_min, set_in_min, offset);\t\t\\\n" + "+static SENSOR_DEVICE_ATTR(in##offset##_max, S_IRUGO | S_IWUSR,\t\\\n" + "+\t\tshow_in_max, set_in_max, offset);\n" + " \n" + " \n" + " in_reg(0);\n" + "@@ -843,30 +836,38 @@ static ssize_t set_in16_max(struct devic\n" + " \treturn count;\n" + " }\n" + " \n" + "-static DEVICE_ATTR(in16_input, S_IRUGO, show_in16, NULL);\n" + "-static DEVICE_ATTR(in16_min, S_IRUGO | S_IWUSR, show_in16_min, set_in16_min);\n" + "-static DEVICE_ATTR(in16_max, S_IRUGO | S_IWUSR, show_in16_max, set_in16_max);\n" + "+static SENSOR_DEVICE_ATTR(in16_input, S_IRUGO, show_in16, NULL, 16);\n" + "+static SENSOR_DEVICE_ATTR(in16_min, S_IRUGO | S_IWUSR, show_in16_min, set_in16_min, 16);\n" + "+static SENSOR_DEVICE_ATTR(in16_max, S_IRUGO | S_IWUSR, show_in16_max, set_in16_max, 16);\n" + " \n" + " \n" + " \n" + " \n" + " /* Now add fan read/write functions */\n" + " \n" + "-static ssize_t show_fan(struct device *dev, char *buf, int nr)\n" + "+static ssize_t show_fan(struct device *dev, struct device_attribute *attr,\n" + "+\t\tchar *buf)\n" + " {\n" + "+\tstruct sensor_device_attribute *sensor_attr= to_sensor_dev_attr(attr);\n" + "+\tint nr = sensor_attr->index;\n" + " \tstruct adm1026_data *data = adm1026_update_device(dev);\n" + " \treturn sprintf(buf,\"%d\\n\", FAN_FROM_REG(data->fan[nr],\n" + " \t\tdata->fan_div[nr]));\n" + " }\n" + "-static ssize_t show_fan_min(struct device *dev, char *buf, int nr)\n" + "+static ssize_t show_fan_min(struct device *dev, struct device_attribute *attr,\n" + "+\t\tchar *buf)\n" + " {\n" + "+\tstruct sensor_device_attribute *sensor_attr= to_sensor_dev_attr(attr);\n" + "+\tint nr = sensor_attr->index;\n" + " \tstruct adm1026_data *data = adm1026_update_device(dev);\n" + " \treturn sprintf(buf,\"%d\\n\", FAN_FROM_REG(data->fan_min[nr],\n" + " \t\tdata->fan_div[nr]));\n" + " }\n" + "-static ssize_t set_fan_min(struct device *dev, const char *buf,\n" + "-\t\tsize_t count, int nr)\n" + "+static ssize_t set_fan_min(struct device *dev, struct device_attribute *attr,\n" + "+\t\tconst char *buf, size_t count)\n" + " {\n" + "+\tstruct sensor_device_attribute *sensor_attr= to_sensor_dev_attr(attr);\n" + "+\tint nr = sensor_attr->index;\n" + " \tstruct i2c_client *client = to_i2c_client(dev);\n" + " \tstruct adm1026_data *data = i2c_get_clientdata(client);\n" + " \tint val = simple_strtol(buf, NULL, 10);\n" + "@@ -879,23 +880,11 @@ static ssize_t set_fan_min(struct device\n" + " \treturn count;\n" + " }\n" + " \n" + "-#define fan_offset(offset) \\\n" + "-static ssize_t show_fan_##offset (struct device *dev, struct device_attribute *attr, char *buf) \\\n" + "-{ \\\n" + "-\treturn show_fan(dev, buf, offset - 1); \\\n" + "-} \\\n" + "-static ssize_t show_fan_##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \\\n" + "-{ \\\n" + "-\treturn show_fan_min(dev, buf, offset - 1); \\\n" + "-} \\\n" + "-static ssize_t set_fan_##offset##_min (struct device *dev, struct device_attribute *attr, \\\n" + "-\tconst char *buf, size_t count) \\\n" + "-{ \\\n" + "-\treturn set_fan_min(dev, buf, count, offset - 1); \\\n" + "-} \\\n" + "-static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_fan_##offset, NULL); \\\n" + "-static DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR, \\\n" + "-\t\tshow_fan_##offset##_min, set_fan_##offset##_min);\n" + "+#define fan_offset(offset) \t\t\\\n" + "+static SENSOR_DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_fan, NULL, \t\\\n" + "+\t\toffset - 1);\t\t\t\t\t\t\t\\\n" + "+static SENSOR_DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR, \t\\\n" + "+\t\tshow_fan_min, set_fan_min, offset - 1);\n" + " \n" + " fan_offset(1);\n" + " fan_offset(2);\n" + "@@ -926,14 +915,19 @@ static void fixup_fan_min(struct device \n" + " }\n" + " \n" + " /* Now add fan_div read/write functions */\n" + "-static ssize_t show_fan_div(struct device *dev, char *buf, int nr)\n" + "+static ssize_t show_fan_div(struct device *dev, struct device_attribute *attr,\n" + "+\t\tchar *buf)\n" + " {\n" + "+\tstruct sensor_device_attribute *sensor_attr= to_sensor_dev_attr(attr);\n" + "+\tint nr = sensor_attr->index;\n" + " \tstruct adm1026_data *data = adm1026_update_device(dev);\n" + " \treturn sprintf(buf,\"%d\\n\", data->fan_div[nr]);\n" + " }\n" + "-static ssize_t set_fan_div(struct device *dev, const char *buf,\n" + "-\t\tsize_t count, int nr)\n" + "+static ssize_t set_fan_div(struct device *dev, struct device_attribute *attr,\n" + "+\t\tconst char *buf, size_t count)\n" + " {\n" + "+\tstruct sensor_device_attribute *sensor_attr= to_sensor_dev_attr(attr);\n" + "+\tint nr = sensor_attr->index;\n" + " \tstruct i2c_client *client = to_i2c_client(dev);\n" + " \tstruct adm1026_data *data = i2c_get_clientdata(client);\n" + " \tint val,orig_div,new_div,shift;\n" + "@@ -967,17 +961,8 @@ static ssize_t set_fan_div(struct device\n" + " }\n" + " \n" + " #define fan_offset_div(offset) \\\n" + "-static ssize_t show_fan_##offset##_div (struct device *dev, struct device_attribute *attr, char *buf) \\\n" + "-{ \\\n" + "-\treturn show_fan_div(dev, buf, offset - 1); \\\n" + "-} \\\n" + "-static ssize_t set_fan_##offset##_div (struct device *dev, struct device_attribute *attr, \\\n" + "-\tconst char *buf, size_t count) \\\n" + "-{ \\\n" + "-\treturn set_fan_div(dev, buf, count, offset - 1); \\\n" + "-} \\\n" + "-static DEVICE_ATTR(fan##offset##_div, S_IRUGO | S_IWUSR, \\\n" + "-\t\tshow_fan_##offset##_div, set_fan_##offset##_div);\n" + "+static SENSOR_DEVICE_ATTR(fan##offset##_div, S_IRUGO | S_IWUSR, \\\n" + "+\t\tshow_fan_div, set_fan_div, offset - 1);\n" + " \n" + " fan_offset_div(1);\n" + " fan_offset_div(2);\n" + "@@ -989,19 +974,27 @@ fan_offset_div(7);\n" + " fan_offset_div(8);\n" + " \n" + " /* Temps */\n" + "-static ssize_t show_temp(struct device *dev, char *buf, int nr)\n" + "+static ssize_t show_temp(struct device *dev, struct device_attribute *attr,\n" + "+\t\tchar *buf)\n" + " {\n" + "+\tstruct sensor_device_attribute *sensor_attr= to_sensor_dev_attr(attr);\n" + "+\tint nr = sensor_attr->index;\n" + " \tstruct adm1026_data *data = adm1026_update_device(dev);\n" + " \treturn sprintf(buf,\"%d\\n\", TEMP_FROM_REG(data->temp[nr]));\n" + " }\n" + "-static ssize_t show_temp_min(struct device *dev, char *buf, int nr)\n" + "+static ssize_t show_temp_min(struct device *dev, struct device_attribute *attr,\n" + "+\t\tchar *buf)\n" + " {\n" + "+\tstruct sensor_device_attribute *sensor_attr= to_sensor_dev_attr(attr);\n" + "+\tint nr = sensor_attr->index;\n" + " \tstruct adm1026_data *data = adm1026_update_device(dev);\n" + " \treturn sprintf(buf,\"%d\\n\", TEMP_FROM_REG(data->temp_min[nr]));\n" + " }\n" + "-static ssize_t set_temp_min(struct device *dev, const char *buf,\n" + "-\t\tsize_t count, int nr)\n" + "+static ssize_t set_temp_min(struct device *dev, struct device_attribute *attr,\n" + "+\t\tconst char *buf, size_t count)\n" + " {\n" + "+\tstruct sensor_device_attribute *sensor_attr= to_sensor_dev_attr(attr);\n" + "+\tint nr = sensor_attr->index;\n" + " \tstruct i2c_client *client = to_i2c_client(dev);\n" + " \tstruct adm1026_data *data = i2c_get_clientdata(client);\n" + " \tint val = simple_strtol(buf, NULL, 10);\n" + "@@ -1013,14 +1006,19 @@ static ssize_t set_temp_min(struct devic\n" + " \tup(&data->update_lock);\n" + " \treturn count;\n" + " }\n" + "-static ssize_t show_temp_max(struct device *dev, char *buf, int nr)\n" + "+static ssize_t show_temp_max(struct device *dev, struct device_attribute *attr,\n" + "+\t\tchar *buf)\n" + " {\n" + "+\tstruct sensor_device_attribute *sensor_attr= to_sensor_dev_attr(attr);\n" + "+\tint nr = sensor_attr->index;\n" + " \tstruct adm1026_data *data = adm1026_update_device(dev);\n" + " \treturn sprintf(buf,\"%d\\n\", TEMP_FROM_REG(data->temp_max[nr]));\n" + " }\n" + "-static ssize_t set_temp_max(struct device *dev, const char *buf,\n" + "-\t\tsize_t count, int nr)\n" + "+static ssize_t set_temp_max(struct device *dev, struct device_attribute *attr,\n" + "+\t\tconst char *buf, size_t count)\n" + " {\n" + "+\tstruct sensor_device_attribute *sensor_attr= to_sensor_dev_attr(attr);\n" + "+\tint nr = sensor_attr->index;\n" + " \tstruct i2c_client *client = to_i2c_client(dev);\n" + " \tstruct adm1026_data *data = i2c_get_clientdata(client);\n" + " \tint val = simple_strtol(buf, NULL, 10);\n" + "@@ -1032,48 +1030,34 @@ static ssize_t set_temp_max(struct devic\n" + " \tup(&data->update_lock);\n" + " \treturn count;\n" + " }\n" + "-#define temp_reg(offset) \\\n" + "-static ssize_t show_temp_##offset (struct device *dev, struct device_attribute *attr, char *buf) \\\n" + "-{ \\\n" + "-\treturn show_temp(dev, buf, offset - 1); \\\n" + "-} \\\n" + "-static ssize_t show_temp_##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \\\n" + "-{ \\\n" + "-\treturn show_temp_min(dev, buf, offset - 1); \\\n" + "-} \\\n" + "-static ssize_t show_temp_##offset##_max (struct device *dev, struct device_attribute *attr, char *buf) \\\n" + "-{ \\\n" + "-\treturn show_temp_max(dev, buf, offset - 1); \\\n" + "-} \\\n" + "-static ssize_t set_temp_##offset##_min (struct device *dev, struct device_attribute *attr, \\\n" + "-\tconst char *buf, size_t count) \\\n" + "-{ \\\n" + "-\treturn set_temp_min(dev, buf, count, offset - 1); \\\n" + "-} \\\n" + "-static ssize_t set_temp_##offset##_max (struct device *dev, struct device_attribute *attr, \\\n" + "-\tconst char *buf, size_t count) \\\n" + "-{ \\\n" + "-\treturn set_temp_max(dev, buf, count, offset - 1); \\\n" + "-} \\\n" + "-static DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_temp_##offset, NULL); \\\n" + "-static DEVICE_ATTR(temp##offset##_min, S_IRUGO | S_IWUSR, \\\n" + "-\t\tshow_temp_##offset##_min, set_temp_##offset##_min); \\\n" + "-static DEVICE_ATTR(temp##offset##_max, S_IRUGO | S_IWUSR, \\\n" + "-\t\tshow_temp_##offset##_max, set_temp_##offset##_max);\n" + "+\n" + "+#define temp_reg(offset)\t\t\t\t\t\t\\\n" + "+static SENSOR_DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_temp, \t\\\n" + "+\t\tNULL, offset - 1);\t\t\t\t\t\\\n" + "+static SENSOR_DEVICE_ATTR(temp##offset##_min, S_IRUGO | S_IWUSR,\t\\\n" + "+\t\tshow_temp_min, set_temp_min, offset - 1);\t\t\\\n" + "+static SENSOR_DEVICE_ATTR(temp##offset##_max, S_IRUGO | S_IWUSR,\t\\\n" + "+\t\tshow_temp_max, set_temp_max, offset - 1);\n" + " \n" + " \n" + " temp_reg(1);\n" + " temp_reg(2);\n" + " temp_reg(3);\n" + " \n" + "-static ssize_t show_temp_offset(struct device *dev, char *buf, int nr)\n" + "+static ssize_t show_temp_offset(struct device *dev, \n" + "+\t\tstruct device_attribute *attr, char *buf)\n" + " {\n" + "+\tstruct sensor_device_attribute *sensor_attr= to_sensor_dev_attr(attr);\n" + "+\tint nr = sensor_attr->index;\n" + " \tstruct adm1026_data *data = adm1026_update_device(dev);\n" + " \treturn sprintf(buf,\"%d\\n\", TEMP_FROM_REG(data->temp_offset[nr]));\n" + " }\n" + "-static ssize_t set_temp_offset(struct device *dev, const char *buf,\n" + "-\t\tsize_t count, int nr)\n" + "+static ssize_t set_temp_offset(struct device *dev, \n" + "+\t\tstruct device_attribute *attr, const char *buf,\n" + "+\t\tsize_t count)\n" + " {\n" + "+\tstruct sensor_device_attribute *sensor_attr= to_sensor_dev_attr(attr);\n" + "+\tint nr = sensor_attr->index;\n" + " \tstruct i2c_client *client = to_i2c_client(dev);\n" + " \tstruct adm1026_data *data = i2c_get_clientdata(client);\n" + " \tint val = simple_strtol(buf, NULL, 10);\n" + "@@ -1086,46 +1070,45 @@ static ssize_t set_temp_offset(struct de\n" + " \treturn count;\n" + " }\n" + " \n" + "-#define temp_offset_reg(offset) \\\n" + "-static ssize_t show_temp_##offset##_offset (struct device *dev, struct device_attribute *attr, char *buf) \\\n" + "-{ \\\n" + "-\treturn show_temp_offset(dev, buf, offset - 1); \\\n" + "-} \\\n" + "-static ssize_t set_temp_##offset##_offset (struct device *dev, struct device_attribute *attr, \\\n" + "-\tconst char *buf, size_t count) \\\n" + "-{ \\\n" + "-\treturn set_temp_offset(dev, buf, count, offset - 1); \\\n" + "-} \\\n" + "-static DEVICE_ATTR(temp##offset##_offset, S_IRUGO | S_IWUSR, \\\n" + "-\t\tshow_temp_##offset##_offset, set_temp_##offset##_offset);\n" + "+#define temp_offset_reg(offset)\t\t\t\t\t\t\t\\\n" + "+static SENSOR_DEVICE_ATTR(temp##offset##_offset, S_IRUGO | S_IWUSR,\t\t\\\n" + "+\t\tshow_temp_offset, set_temp_offset, offset - 1);\n" + " \n" + " temp_offset_reg(1);\n" + " temp_offset_reg(2);\n" + " temp_offset_reg(3);\n" + " \n" + "-static ssize_t show_temp_auto_point1_temp_hyst(struct device *dev, char *buf,\n" + "-\t\tint nr)\n" + "+static ssize_t show_temp_auto_point1_temp_hyst(struct device *dev, \n" + "+\t\tstruct device_attribute *attr, char *buf)\n" + " {\n" + "+\tstruct sensor_device_attribute *sensor_attr= to_sensor_dev_attr(attr);\n" + "+\tint nr = sensor_attr->index;\n" + " \tstruct adm1026_data *data = adm1026_update_device(dev);\n" + " \treturn sprintf(buf,\"%d\\n\", TEMP_FROM_REG(\n" + " \t\tADM1026_FAN_ACTIVATION_TEMP_HYST + data->temp_tmin[nr]));\n" + " }\n" + "-static ssize_t show_temp_auto_point2_temp(struct device *dev, char *buf,\n" + "-\t\tint nr)\n" + "+static ssize_t show_temp_auto_point2_temp(struct device *dev, \n" + "+\t\tstruct device_attribute *attr, char *buf)\n" + " {\n" + "+\tstruct sensor_device_attribute *sensor_attr= to_sensor_dev_attr(attr);\n" + "+\tint nr = sensor_attr->index;\n" + " \tstruct adm1026_data *data = adm1026_update_device(dev);\n" + " \treturn sprintf(buf,\"%d\\n\", TEMP_FROM_REG(data->temp_tmin[nr] +\n" + " \t\tADM1026_FAN_CONTROL_TEMP_RANGE));\n" + " }\n" + "-static ssize_t show_temp_auto_point1_temp(struct device *dev, char *buf,\n" + "-\t\tint nr)\n" + "+static ssize_t show_temp_auto_point1_temp(struct device *dev, \n" + "+\t\tstruct device_attribute *attr, char *buf)\n" + " {\n" + "+\tstruct sensor_device_attribute *sensor_attr= to_sensor_dev_attr(attr);\n" + "+\tint nr = sensor_attr->index;\n" + " \tstruct adm1026_data *data = adm1026_update_device(dev);\n" + " \treturn sprintf(buf,\"%d\\n\", TEMP_FROM_REG(data->temp_tmin[nr]));\n" + " }\n" + "-static ssize_t set_temp_auto_point1_temp(struct device *dev, const char *buf,\n" + "-\t\tsize_t count, int nr)\n" + "+static ssize_t set_temp_auto_point1_temp(struct device *dev, \n" + "+\t\tstruct device_attribute *attr, const char *buf, size_t count)\n" + " {\n" + "+\tstruct sensor_device_attribute *sensor_attr= to_sensor_dev_attr(attr);\n" + "+\tint nr = sensor_attr->index;\n" + " \tstruct i2c_client *client = to_i2c_client(dev);\n" + " \tstruct adm1026_data *data = i2c_get_clientdata(client);\n" + " \tint val = simple_strtol(buf, NULL, 10);\n" + "@@ -1138,46 +1121,27 @@ static ssize_t set_temp_auto_point1_temp\n" + " \treturn count;\n" + " }\n" + " \n" + "-#define temp_auto_point(offset) \\\n" + "-static ssize_t show_temp##offset##_auto_point1_temp (struct device *dev, struct device_attribute *attr, \\\n" + "-\tchar *buf) \\\n" + "-{ \\\n" + "-\treturn show_temp_auto_point1_temp(dev, buf, offset - 1); \\\n" + "-} \\\n" + "-static ssize_t set_temp##offset##_auto_point1_temp (struct device *dev, struct device_attribute *attr, \\\n" + "-\tconst char *buf, size_t count) \\\n" + "-{ \\\n" + "-\treturn set_temp_auto_point1_temp(dev, buf, count, offset - 1); \\\n" + "-} \\\n" + "-static ssize_t show_temp##offset##_auto_point1_temp_hyst (struct device \\\n" + "-\t*dev, struct device_attribute *attr, char *buf) \\\n" + "-{ \\\n" + "-\treturn show_temp_auto_point1_temp_hyst(dev, buf, offset - 1); \\\n" + "-} \\\n" + "-static ssize_t show_temp##offset##_auto_point2_temp (struct device *dev, struct device_attribute *attr, \\\n" + "-\t char *buf) \\\n" + "-{ \\\n" + "-\treturn show_temp_auto_point2_temp(dev, buf, offset - 1); \\\n" + "-} \\\n" + "-static DEVICE_ATTR(temp##offset##_auto_point1_temp, S_IRUGO | S_IWUSR, \\\n" + "-\t\tshow_temp##offset##_auto_point1_temp, \\\n" + "-\t\tset_temp##offset##_auto_point1_temp); \\\n" + "-static DEVICE_ATTR(temp##offset##_auto_point1_temp_hyst, S_IRUGO, \\\n" + "-\t\tshow_temp##offset##_auto_point1_temp_hyst, NULL); \\\n" + "-static DEVICE_ATTR(temp##offset##_auto_point2_temp, S_IRUGO, \\\n" + "-\t\tshow_temp##offset##_auto_point2_temp, NULL);\n" + "+#define temp_auto_point(offset)\t\t\t\t\t\t\t\\\n" + "+static SENSOR_DEVICE_ATTR(temp##offset##_auto_point1_temp, S_IRUGO | S_IWUSR,\t\\\n" + "+\t\tshow_temp_auto_point1_temp, set_temp_auto_point1_temp, \t\t\\\n" + "+\t\toffset - 1);\t\t\t\t\t\t\t\\\n" + "+static SENSOR_DEVICE_ATTR(temp##offset##_auto_point1_temp_hyst, S_IRUGO,\t\\\n" + "+\t\tshow_temp_auto_point1_temp_hyst, NULL, offset - 1);\t\t\\\n" + "+static SENSOR_DEVICE_ATTR(temp##offset##_auto_point2_temp, S_IRUGO,\t\t\\\n" + "+\t\tshow_temp_auto_point2_temp, NULL, offset - 1);\n" + " \n" + " temp_auto_point(1);\n" + " temp_auto_point(2);\n" + " temp_auto_point(3);\n" + " \n" + "-static ssize_t show_temp_crit_enable(struct device *dev, struct device_attribute *attr, char *buf)\n" + "+static ssize_t show_temp_crit_enable(struct device *dev, \n" + "+\t\tstruct device_attribute *attr, char *buf)\n" + " {\n" + " \tstruct adm1026_data *data = adm1026_update_device(dev);\n" + " \treturn sprintf(buf,\"%d\\n\", (data->config1 & CFG1_THERM_HOT) >> 4);\n" + " }\n" + "-static ssize_t set_temp_crit_enable(struct device *dev, struct device_attribute *attr, const char *buf,\n" + "-\t\tsize_t count)\n" + "+static ssize_t set_temp_crit_enable(struct device *dev, \n" + "+\t\tstruct device_attribute *attr, const char *buf, size_t count)\n" + " {\n" + " \tstruct i2c_client *client = to_i2c_client(dev);\n" + " \tstruct adm1026_data *data = i2c_get_clientdata(client);\n" + "@@ -1193,24 +1157,27 @@ static ssize_t set_temp_crit_enable(stru\n" + " \treturn count;\n" + " }\n" + " \n" + "-static DEVICE_ATTR(temp1_crit_enable, S_IRUGO | S_IWUSR, \n" + "-\tshow_temp_crit_enable, set_temp_crit_enable);\n" + "-\n" + "-static DEVICE_ATTR(temp2_crit_enable, S_IRUGO | S_IWUSR, \n" + "-\tshow_temp_crit_enable, set_temp_crit_enable);\n" + "-\n" + "-static DEVICE_ATTR(temp3_crit_enable, S_IRUGO | S_IWUSR, \n" + "+#define temp_crit_enable(offset)\t\t\t\t\\\n" + "+static DEVICE_ATTR(temp##offset##_crit_enable, S_IRUGO | S_IWUSR, \\\n" + " \tshow_temp_crit_enable, set_temp_crit_enable);\n" + " \n" + "+temp_crit_enable(1);\n" + "+temp_crit_enable(2);\n" + "+temp_crit_enable(3);\n" + " \n" + "-static ssize_t show_temp_crit(struct device *dev, char *buf, int nr)\n" + "+static ssize_t show_temp_crit(struct device *dev, \n" + "+\t\tstruct device_attribute *attr, char *buf)\n" + " {\n" + "+\tstruct sensor_device_attribute *sensor_attr= to_sensor_dev_attr(attr);\n" + "+\tint nr = sensor_attr->index;\n" + " \tstruct adm1026_data *data = adm1026_update_device(dev);\n" + " \treturn sprintf(buf,\"%d\\n\", TEMP_FROM_REG(data->temp_crit[nr]));\n" + " }\n" + "-static ssize_t set_temp_crit(struct device *dev, const char *buf,\n" + "-\t\tsize_t count, int nr)\n" + "+static ssize_t set_temp_crit(struct device *dev, struct device_attribute *attr,\n" + "+\t\tconst char *buf, size_t count)\n" + " {\n" + "+\tstruct sensor_device_attribute *sensor_attr= to_sensor_dev_attr(attr);\n" + "+\tint nr = sensor_attr->index;\n" + " \tstruct i2c_client *client = to_i2c_client(dev);\n" + " \tstruct adm1026_data *data = i2c_get_clientdata(client);\n" + " \tint val = simple_strtol(buf, NULL, 10);\n" + "@@ -1223,18 +1190,9 @@ static ssize_t set_temp_crit(struct devi\n" + " \treturn count;\n" + " }\n" + " \n" + "-#define temp_crit_reg(offset) \\\n" + "-static ssize_t show_temp_##offset##_crit (struct device *dev, struct device_attribute *attr, char *buf) \\\n" + "-{ \\\n" + "-\treturn show_temp_crit(dev, buf, offset - 1); \\\n" + "-} \\\n" + "-static ssize_t set_temp_##offset##_crit (struct device *dev, struct device_attribute *attr, \\\n" + "-\tconst char *buf, size_t count) \\\n" + "-{ \\\n" + "-\treturn set_temp_crit(dev, buf, count, offset - 1); \\\n" + "-} \\\n" + "-static DEVICE_ATTR(temp##offset##_crit, S_IRUGO | S_IWUSR, \\\n" + "-\t\tshow_temp_##offset##_crit, set_temp_##offset##_crit);\n" + "+#define temp_crit_reg(offset)\t\t\t\t\t\t\\\n" + "+static SENSOR_DEVICE_ATTR(temp##offset##_crit, S_IRUGO | S_IWUSR,\t\\\n" + "+\t\tshow_temp_crit, set_temp_crit, offset - 1);\n" + " \n" + " temp_crit_reg(1);\n" + " temp_crit_reg(2);\n" + "@@ -1597,114 +1555,114 @@ int adm1026_detect(struct i2c_adapter *a\n" + " \tadm1026_init_client(new_client);\n" + " \n" + " \t/* Register sysfs hooks */\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_in0_input);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_in0_max);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_in0_min);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_in1_input);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_in1_max);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_in1_min);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_in2_input);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_in2_max);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_in2_min);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_in3_input);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_in3_max);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_in3_min);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_in4_input);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_in4_max);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_in4_min);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_in5_input);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_in5_max);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_in5_min);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_in6_input);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_in6_max);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_in6_min);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_in7_input);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_in7_max);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_in7_min);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_in8_input);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_in8_max);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_in8_min);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_in9_input);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_in9_max);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_in9_min);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_in10_input);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_in10_max);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_in10_min);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_in11_input);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_in11_max);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_in11_min);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_in12_input);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_in12_max);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_in12_min);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_in13_input);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_in13_max);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_in13_min);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_in14_input);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_in14_max);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_in14_min);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_in15_input);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_in15_max);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_in15_min);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_in16_input);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_in16_max);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_in16_min);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_fan1_input);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_fan1_div);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_fan1_min);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_fan2_input);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_fan2_div);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_fan2_min);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_fan3_input);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_fan3_div);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_fan3_min);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_fan4_input);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_fan4_div);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_fan4_min);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_fan5_input);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_fan5_div);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_fan5_min);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_fan6_input);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_fan6_div);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_fan6_min);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_fan7_input);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_fan7_div);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_fan7_min);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_fan8_input);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_fan8_div);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_fan8_min);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_temp1_input);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_temp1_max);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_temp1_min);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_temp2_input);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_temp2_max);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_temp2_min);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_temp3_input);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_temp3_max);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_temp3_min);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_temp1_offset);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_temp2_offset);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_temp3_offset);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_in0_input.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_in0_max.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_in0_min.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_in1_input.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_in1_max.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_in1_min.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_in2_input.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_in2_max.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_in2_min.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_in3_input.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_in3_max.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_in3_min.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_in4_input.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_in4_max.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_in4_min.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_in5_input.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_in5_max.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_in5_min.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_in6_input.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_in6_max.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_in6_min.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_in7_input.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_in7_max.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_in7_min.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_in8_input.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_in8_max.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_in8_min.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_in9_input.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_in9_max.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_in9_min.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_in10_input.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_in10_max.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_in10_min.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_in11_input.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_in11_max.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_in11_min.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_in12_input.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_in12_max.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_in12_min.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_in13_input.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_in13_max.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_in13_min.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_in14_input.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_in14_max.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_in14_min.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_in15_input.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_in15_max.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_in15_min.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_in16_input.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_in16_max.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_in16_min.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_fan1_input.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_fan1_div.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_fan1_min.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_fan2_input.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_fan2_div.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_fan2_min.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_fan3_input.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_fan3_div.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_fan3_min.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_fan4_input.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_fan4_div.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_fan4_min.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_fan5_input.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_fan5_div.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_fan5_min.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_fan6_input.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_fan6_div.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_fan6_min.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_fan7_input.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_fan7_div.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_fan7_min.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_fan8_input.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_fan8_div.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_fan8_min.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_temp1_input.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_temp1_max.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_temp1_min.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_temp2_input.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_temp2_max.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_temp2_min.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_temp3_input.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_temp3_max.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_temp3_min.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_temp1_offset.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_temp2_offset.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_temp3_offset.dev_attr);\n" + " \tdevice_create_file(&new_client->dev, \n" + "-\t\t&dev_attr_temp1_auto_point1_temp);\n" + "+\t\t&sensor_dev_attr_temp1_auto_point1_temp.dev_attr);\n" + " \tdevice_create_file(&new_client->dev, \n" + "-\t\t&dev_attr_temp2_auto_point1_temp);\n" + "+\t\t&sensor_dev_attr_temp2_auto_point1_temp.dev_attr);\n" + " \tdevice_create_file(&new_client->dev, \n" + "-\t\t&dev_attr_temp3_auto_point1_temp);\n" + "+\t\t&sensor_dev_attr_temp3_auto_point1_temp.dev_attr);\n" + " \tdevice_create_file(&new_client->dev,\n" + "-\t\t&dev_attr_temp1_auto_point1_temp_hyst);\n" + "+\t\t&sensor_dev_attr_temp1_auto_point1_temp_hyst.dev_attr);\n" + " \tdevice_create_file(&new_client->dev,\n" + "-\t\t&dev_attr_temp2_auto_point1_temp_hyst);\n" + "+\t\t&sensor_dev_attr_temp2_auto_point1_temp_hyst.dev_attr);\n" + " \tdevice_create_file(&new_client->dev,\n" + "-\t\t&dev_attr_temp3_auto_point1_temp_hyst);\n" + "+\t\t&sensor_dev_attr_temp3_auto_point1_temp_hyst.dev_attr);\n" + " \tdevice_create_file(&new_client->dev, \n" + "-\t\t&dev_attr_temp1_auto_point2_temp);\n" + "+\t\t&sensor_dev_attr_temp1_auto_point2_temp.dev_attr);\n" + " \tdevice_create_file(&new_client->dev, \n" + "-\t\t&dev_attr_temp2_auto_point2_temp);\n" + "+\t\t&sensor_dev_attr_temp2_auto_point2_temp.dev_attr);\n" + " \tdevice_create_file(&new_client->dev, \n" + "-\t\t&dev_attr_temp3_auto_point2_temp);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_temp1_crit);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_temp2_crit);\n" + "-\tdevice_create_file(&new_client->dev, &dev_attr_temp3_crit);\n" + "+\t\t&sensor_dev_attr_temp3_auto_point2_temp.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_temp1_crit.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_temp2_crit.dev_attr);\n" + "+\tdevice_create_file(&new_client->dev, &sensor_dev_attr_temp3_crit.dev_attr);\n" + " \tdevice_create_file(&new_client->dev, &dev_attr_temp1_crit_enable);\n" + " \tdevice_create_file(&new_client->dev, &dev_attr_temp2_crit_enable);\n" + " \tdevice_create_file(&new_client->dev, &dev_attr_temp3_crit_enable);\n" + "diff -uprN -X dontdiff linux-2.6.12-rc4-sysfsdyncallback-deviceattr-i2c/include/linux/i2c-sysfs.h linux-2.6.12-rc4-sysfsdyncallback-deviceattr-i2c-adm1026/include/linux/i2c-sysfs.h\n" + "--- linux-2.6.12-rc4-sysfsdyncallback-deviceattr-i2c/include/linux/i2c-sysfs.h\t2005-05-16 23:30:12.000000000 -0400\n" + "+++ linux-2.6.12-rc4-sysfsdyncallback-deviceattr-i2c-adm1026/include/linux/i2c-sysfs.h\t2005-05-17 02:11:39.000000000 -0400\n" + "@@ -31,7 +31,7 @@ container_of(_dev_attr, struct sensor_de\n" + " #define SENSOR_DEVICE_ATTR(_name,_mode,_show,_store,_index)\t\\\n" + " struct sensor_device_attribute sensor_dev_attr_##_name = {\t\\\n" + " \t.dev_attr=__ATTR(_name,_mode,_show,_store),\t\t\\\n" + "-\t.index_index,\t\t\t\t\t\t\\\n" + "+\t.index=_index,\t\t\t\t\t\t\\\n" + " }\n" + " \n" + #endif /* _LINUX_I2C_SYSFS_H */ -05770a76da79b093b851addc3183fca6e71e171bf0c06bc1e56ccddcc66b71b3 +a8a1289c81f53f06b6afe6e669b21021c95d3c5eb6a3c145a639a9a507ded7c1
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.