aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/chips/adm1021.c6
-rw-r--r--drivers/i2c/chips/adm1025.c28
-rw-r--r--drivers/i2c/chips/adm1026.c572
-rw-r--r--drivers/i2c/chips/adm1031.c44
-rw-r--r--drivers/i2c/chips/asb100.c46
-rw-r--r--drivers/i2c/chips/ds1621.c6
-rw-r--r--drivers/i2c/chips/fscher.c8
-rw-r--r--drivers/i2c/chips/fscpos.c16
-rw-r--r--drivers/i2c/chips/gl518sm.c12
-rw-r--r--drivers/i2c/chips/gl520sm.c8
-rw-r--r--drivers/i2c/chips/it87.c50
-rw-r--r--drivers/i2c/chips/lm63.c24
-rw-r--r--drivers/i2c/chips/lm75.c4
-rw-r--r--drivers/i2c/chips/lm77.c14
-rw-r--r--drivers/i2c/chips/lm78.c36
-rw-r--r--drivers/i2c/chips/lm80.c20
-rw-r--r--drivers/i2c/chips/lm83.c6
-rw-r--r--drivers/i2c/chips/lm85.c72
-rw-r--r--drivers/i2c/chips/lm87.c46
-rw-r--r--drivers/i2c/chips/lm90.c12
-rw-r--r--drivers/i2c/chips/lm92.c14
-rw-r--r--drivers/i2c/chips/max1619.c6
-rw-r--r--drivers/i2c/chips/pc87360.c68
-rw-r--r--drivers/i2c/chips/pcf8574.c6
-rw-r--r--drivers/i2c/chips/pcf8591.c10
-rw-r--r--drivers/i2c/chips/sis5595.c34
-rw-r--r--drivers/i2c/chips/smsc47b397.c4
-rw-r--r--drivers/i2c/chips/smsc47m1.c20
-rw-r--r--drivers/i2c/chips/via686a.c32
-rw-r--r--drivers/i2c/chips/w83627hf.c56
-rw-r--r--drivers/i2c/chips/w83781d.c52
-rw-r--r--drivers/i2c/chips/w83l785ts.c4
-rw-r--r--drivers/i2c/i2c-core.c4
33 files changed, 649 insertions, 691 deletions
diff --git a/drivers/i2c/chips/adm1021.c b/drivers/i2c/chips/adm1021.c
index 9c59a370b6d9..9058c3956710 100644
--- a/drivers/i2c/chips/adm1021.c
+++ b/drivers/i2c/chips/adm1021.c
@@ -137,7 +137,7 @@ static struct i2c_driver adm1021_driver = {
137}; 137};
138 138
139#define show(value) \ 139#define show(value) \
140static ssize_t show_##value(struct device *dev, char *buf) \ 140static ssize_t show_##value(struct device *dev, struct device_attribute *attr, char *buf) \
141{ \ 141{ \
142 struct adm1021_data *data = adm1021_update_device(dev); \ 142 struct adm1021_data *data = adm1021_update_device(dev); \
143 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->value)); \ 143 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->value)); \
@@ -150,7 +150,7 @@ show(remote_temp_hyst);
150show(remote_temp_input); 150show(remote_temp_input);
151 151
152#define show2(value) \ 152#define show2(value) \
153static ssize_t show_##value(struct device *dev, char *buf) \ 153static ssize_t show_##value(struct device *dev, struct device_attribute *attr, char *buf) \
154{ \ 154{ \
155 struct adm1021_data *data = adm1021_update_device(dev); \ 155 struct adm1021_data *data = adm1021_update_device(dev); \
156 return sprintf(buf, "%d\n", data->value); \ 156 return sprintf(buf, "%d\n", data->value); \
@@ -159,7 +159,7 @@ show2(alarms);
159show2(die_code); 159show2(die_code);
160 160
161#define set(value, reg) \ 161#define set(value, reg) \
162static ssize_t set_##value(struct device *dev, const char *buf, size_t count) \ 162static ssize_t set_##value(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \
163{ \ 163{ \
164 struct i2c_client *client = to_i2c_client(dev); \ 164 struct i2c_client *client = to_i2c_client(dev); \
165 struct adm1021_data *data = i2c_get_clientdata(client); \ 165 struct adm1021_data *data = i2c_get_clientdata(client); \
diff --git a/drivers/i2c/chips/adm1025.c b/drivers/i2c/chips/adm1025.c
index e0771a3d05c9..111f0c86c933 100644
--- a/drivers/i2c/chips/adm1025.c
+++ b/drivers/i2c/chips/adm1025.c
@@ -153,19 +153,19 @@ struct adm1025_data {
153 */ 153 */
154 154
155#define show_in(offset) \ 155#define show_in(offset) \
156static ssize_t show_in##offset(struct device *dev, char *buf) \ 156static ssize_t show_in##offset(struct device *dev, struct device_attribute *attr, char *buf) \
157{ \ 157{ \
158 struct adm1025_data *data = adm1025_update_device(dev); \ 158 struct adm1025_data *data = adm1025_update_device(dev); \
159 return sprintf(buf, "%u\n", IN_FROM_REG(data->in[offset], \ 159 return sprintf(buf, "%u\n", IN_FROM_REG(data->in[offset], \
160 in_scale[offset])); \ 160 in_scale[offset])); \
161} \ 161} \
162static ssize_t show_in##offset##_min(struct device *dev, char *buf) \ 162static ssize_t show_in##offset##_min(struct device *dev, struct device_attribute *attr, char *buf) \
163{ \ 163{ \
164 struct adm1025_data *data = adm1025_update_device(dev); \ 164 struct adm1025_data *data = adm1025_update_device(dev); \
165 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_min[offset], \ 165 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_min[offset], \
166 in_scale[offset])); \ 166 in_scale[offset])); \
167} \ 167} \
168static ssize_t show_in##offset##_max(struct device *dev, char *buf) \ 168static ssize_t show_in##offset##_max(struct device *dev, struct device_attribute *attr, char *buf) \
169{ \ 169{ \
170 struct adm1025_data *data = adm1025_update_device(dev); \ 170 struct adm1025_data *data = adm1025_update_device(dev); \
171 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_max[offset], \ 171 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_max[offset], \
@@ -180,17 +180,17 @@ show_in(4);
180show_in(5); 180show_in(5);
181 181
182#define show_temp(offset) \ 182#define show_temp(offset) \
183static ssize_t show_temp##offset(struct device *dev, char *buf) \ 183static ssize_t show_temp##offset(struct device *dev, struct device_attribute *attr, char *buf) \
184{ \ 184{ \
185 struct adm1025_data *data = adm1025_update_device(dev); \ 185 struct adm1025_data *data = adm1025_update_device(dev); \
186 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp[offset-1])); \ 186 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp[offset-1])); \
187} \ 187} \
188static ssize_t show_temp##offset##_min(struct device *dev, char *buf) \ 188static ssize_t show_temp##offset##_min(struct device *dev, struct device_attribute *attr, char *buf) \
189{ \ 189{ \
190 struct adm1025_data *data = adm1025_update_device(dev); \ 190 struct adm1025_data *data = adm1025_update_device(dev); \
191 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_min[offset-1])); \ 191 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_min[offset-1])); \
192} \ 192} \
193static ssize_t show_temp##offset##_max(struct device *dev, char *buf) \ 193static ssize_t show_temp##offset##_max(struct device *dev, struct device_attribute *attr, char *buf) \
194{ \ 194{ \
195 struct adm1025_data *data = adm1025_update_device(dev); \ 195 struct adm1025_data *data = adm1025_update_device(dev); \
196 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_max[offset-1])); \ 196 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_max[offset-1])); \
@@ -200,7 +200,7 @@ show_temp(1);
200show_temp(2); 200show_temp(2);
201 201
202#define set_in(offset) \ 202#define set_in(offset) \
203static ssize_t set_in##offset##_min(struct device *dev, const char *buf, \ 203static ssize_t set_in##offset##_min(struct device *dev, struct device_attribute *attr, const char *buf, \
204 size_t count) \ 204 size_t count) \
205{ \ 205{ \
206 struct i2c_client *client = to_i2c_client(dev); \ 206 struct i2c_client *client = to_i2c_client(dev); \
@@ -214,7 +214,7 @@ static ssize_t set_in##offset##_min(struct device *dev, const char *buf, \
214 up(&data->update_lock); \ 214 up(&data->update_lock); \
215 return count; \ 215 return count; \
216} \ 216} \
217static ssize_t set_in##offset##_max(struct device *dev, const char *buf, \ 217static ssize_t set_in##offset##_max(struct device *dev, struct device_attribute *attr, const char *buf, \
218 size_t count) \ 218 size_t count) \
219{ \ 219{ \
220 struct i2c_client *client = to_i2c_client(dev); \ 220 struct i2c_client *client = to_i2c_client(dev); \
@@ -240,7 +240,7 @@ set_in(4);
240set_in(5); 240set_in(5);
241 241
242#define set_temp(offset) \ 242#define set_temp(offset) \
243static ssize_t set_temp##offset##_min(struct device *dev, const char *buf, \ 243static ssize_t set_temp##offset##_min(struct device *dev, struct device_attribute *attr, const char *buf, \
244 size_t count) \ 244 size_t count) \
245{ \ 245{ \
246 struct i2c_client *client = to_i2c_client(dev); \ 246 struct i2c_client *client = to_i2c_client(dev); \
@@ -254,7 +254,7 @@ static ssize_t set_temp##offset##_min(struct device *dev, const char *buf, \
254 up(&data->update_lock); \ 254 up(&data->update_lock); \
255 return count; \ 255 return count; \
256} \ 256} \
257static ssize_t set_temp##offset##_max(struct device *dev, const char *buf, \ 257static ssize_t set_temp##offset##_max(struct device *dev, struct device_attribute *attr, const char *buf, \
258 size_t count) \ 258 size_t count) \
259{ \ 259{ \
260 struct i2c_client *client = to_i2c_client(dev); \ 260 struct i2c_client *client = to_i2c_client(dev); \
@@ -275,26 +275,26 @@ static DEVICE_ATTR(temp##offset##_max, S_IWUSR | S_IRUGO, \
275set_temp(1); 275set_temp(1);
276set_temp(2); 276set_temp(2);
277 277
278static ssize_t show_alarms(struct device *dev, char *buf) 278static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf)
279{ 279{
280 struct adm1025_data *data = adm1025_update_device(dev); 280 struct adm1025_data *data = adm1025_update_device(dev);
281 return sprintf(buf, "%u\n", data->alarms); 281 return sprintf(buf, "%u\n", data->alarms);
282} 282}
283static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL); 283static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL);
284 284
285static ssize_t show_vid(struct device *dev, char *buf) 285static ssize_t show_vid(struct device *dev, struct device_attribute *attr, char *buf)
286{ 286{
287 struct adm1025_data *data = adm1025_update_device(dev); 287 struct adm1025_data *data = adm1025_update_device(dev);
288 return sprintf(buf, "%u\n", vid_from_reg(data->vid, data->vrm)); 288 return sprintf(buf, "%u\n", vid_from_reg(data->vid, data->vrm));
289} 289}
290static DEVICE_ATTR(in1_ref, S_IRUGO, show_vid, NULL); 290static DEVICE_ATTR(in1_ref, S_IRUGO, show_vid, NULL);
291 291
292static ssize_t show_vrm(struct device *dev, char *buf) 292static ssize_t show_vrm(struct device *dev, struct device_attribute *attr, char *buf)
293{ 293{
294 struct adm1025_data *data = adm1025_update_device(dev); 294 struct adm1025_data *data = adm1025_update_device(dev);
295 return sprintf(buf, "%u\n", data->vrm); 295 return sprintf(buf, "%u\n", data->vrm);
296} 296}
297static ssize_t set_vrm(struct device *dev, const char *buf, size_t count) 297static ssize_t set_vrm(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
298{ 298{
299 struct i2c_client *client = to_i2c_client(dev); 299 struct i2c_client *client = to_i2c_client(dev);
300 struct adm1025_data *data = i2c_get_clientdata(client); 300 struct adm1025_data *data = i2c_get_clientdata(client);
diff --git a/drivers/i2c/chips/adm1026.c b/drivers/i2c/chips/adm1026.c
index 39e2f4a900bf..b15fafe8f111 100644
--- a/drivers/i2c/chips/adm1026.c
+++ b/drivers/i2c/chips/adm1026.c
@@ -30,6 +30,7 @@
30#include <linux/jiffies.h> 30#include <linux/jiffies.h>
31#include <linux/i2c.h> 31#include <linux/i2c.h>
32#include <linux/i2c-sensor.h> 32#include <linux/i2c-sensor.h>
33#include <linux/i2c-sysfs.h>
33#include <linux/i2c-vid.h> 34#include <linux/i2c-vid.h>
34 35
35/* Addresses to scan */ 36/* Addresses to scan */
@@ -711,19 +712,27 @@ static struct adm1026_data *adm1026_update_device(struct device *dev)
711 return data; 712 return data;
712} 713}
713 714
714static ssize_t show_in(struct device *dev, char *buf, int nr) 715static ssize_t show_in(struct device *dev, struct device_attribute *attr,
716 char *buf)
715{ 717{
718 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
719 int nr = sensor_attr->index;
716 struct adm1026_data *data = adm1026_update_device(dev); 720 struct adm1026_data *data = adm1026_update_device(dev);
717 return sprintf(buf,"%d\n", INS_FROM_REG(nr, data->in[nr])); 721 return sprintf(buf,"%d\n", INS_FROM_REG(nr, data->in[nr]));
718} 722}
719static ssize_t show_in_min(struct device *dev, char *buf, int nr) 723static ssize_t show_in_min(struct device *dev, struct device_attribute *attr,
724 char *buf)
720{ 725{
726 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
727 int nr = sensor_attr->index;
721 struct adm1026_data *data = adm1026_update_device(dev); 728 struct adm1026_data *data = adm1026_update_device(dev);
722 return sprintf(buf,"%d\n", INS_FROM_REG(nr, data->in_min[nr])); 729 return sprintf(buf,"%d\n", INS_FROM_REG(nr, data->in_min[nr]));
723} 730}
724static ssize_t set_in_min(struct device *dev, const char *buf, 731static ssize_t set_in_min(struct device *dev, struct device_attribute *attr,
725 size_t count, int nr) 732 const char *buf, size_t count)
726{ 733{
734 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
735 int nr = sensor_attr->index;
727 struct i2c_client *client = to_i2c_client(dev); 736 struct i2c_client *client = to_i2c_client(dev);
728 struct adm1026_data *data = i2c_get_clientdata(client); 737 struct adm1026_data *data = i2c_get_clientdata(client);
729 int val = simple_strtol(buf, NULL, 10); 738 int val = simple_strtol(buf, NULL, 10);
@@ -734,14 +743,19 @@ static ssize_t set_in_min(struct device *dev, const char *buf,
734 up(&data->update_lock); 743 up(&data->update_lock);
735 return count; 744 return count;
736} 745}
737static ssize_t show_in_max(struct device *dev, char *buf, int nr) 746static ssize_t show_in_max(struct device *dev, struct device_attribute *attr,
747 char *buf)
738{ 748{
749 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
750 int nr = sensor_attr->index;
739 struct adm1026_data *data = adm1026_update_device(dev); 751 struct adm1026_data *data = adm1026_update_device(dev);
740 return sprintf(buf,"%d\n", INS_FROM_REG(nr, data->in_max[nr])); 752 return sprintf(buf,"%d\n", INS_FROM_REG(nr, data->in_max[nr]));
741} 753}
742static ssize_t set_in_max(struct device *dev, const char *buf, 754static ssize_t set_in_max(struct device *dev, struct device_attribute *attr,
743 size_t count, int nr) 755 const char *buf, size_t count)
744{ 756{
757 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
758 int nr = sensor_attr->index;
745 struct i2c_client *client = to_i2c_client(dev); 759 struct i2c_client *client = to_i2c_client(dev);
746 struct adm1026_data *data = i2c_get_clientdata(client); 760 struct adm1026_data *data = i2c_get_clientdata(client);
747 int val = simple_strtol(buf, NULL, 10); 761 int val = simple_strtol(buf, NULL, 10);
@@ -753,34 +767,13 @@ static ssize_t set_in_max(struct device *dev, const char *buf,
753 return count; 767 return count;
754} 768}
755 769
756#define in_reg(offset) \ 770#define in_reg(offset) \
757static ssize_t show_in##offset (struct device *dev, char *buf) \ 771static SENSOR_DEVICE_ATTR(in##offset##_input, S_IRUGO, show_in, \
758{ \ 772 NULL, offset); \
759 return show_in(dev, buf, offset); \ 773static SENSOR_DEVICE_ATTR(in##offset##_min, S_IRUGO | S_IWUSR, \
760} \ 774 show_in_min, set_in_min, offset); \
761static ssize_t show_in##offset##_min (struct device *dev, char *buf) \ 775static SENSOR_DEVICE_ATTR(in##offset##_max, S_IRUGO | S_IWUSR, \
762{ \ 776 show_in_max, set_in_max, offset);
763 return show_in_min(dev, buf, offset); \
764} \
765static ssize_t set_in##offset##_min (struct device *dev, \
766 const char *buf, size_t count) \
767{ \
768 return set_in_min(dev, buf, count, offset); \
769} \
770static ssize_t show_in##offset##_max (struct device *dev, char *buf) \
771{ \
772 return show_in_max(dev, buf, offset); \
773} \
774static ssize_t set_in##offset##_max (struct device *dev, \
775 const char *buf, size_t count) \
776{ \
777 return set_in_max(dev, buf, count, offset); \
778} \
779static DEVICE_ATTR(in##offset##_input, S_IRUGO, show_in##offset, NULL); \
780static DEVICE_ATTR(in##offset##_min, S_IRUGO | S_IWUSR, \
781 show_in##offset##_min, set_in##offset##_min); \
782static DEVICE_ATTR(in##offset##_max, S_IRUGO | S_IWUSR, \
783 show_in##offset##_max, set_in##offset##_max);
784 777
785 778
786in_reg(0); 779in_reg(0);
@@ -800,19 +793,19 @@ in_reg(13);
800in_reg(14); 793in_reg(14);
801in_reg(15); 794in_reg(15);
802 795
803static ssize_t show_in16(struct device *dev, char *buf) 796static ssize_t show_in16(struct device *dev, struct device_attribute *attr, char *buf)
804{ 797{
805 struct adm1026_data *data = adm1026_update_device(dev); 798 struct adm1026_data *data = adm1026_update_device(dev);
806 return sprintf(buf,"%d\n", INS_FROM_REG(16, data->in[16]) - 799 return sprintf(buf,"%d\n", INS_FROM_REG(16, data->in[16]) -
807 NEG12_OFFSET); 800 NEG12_OFFSET);
808} 801}
809static ssize_t show_in16_min(struct device *dev, char *buf) 802static ssize_t show_in16_min(struct device *dev, struct device_attribute *attr, char *buf)
810{ 803{
811 struct adm1026_data *data = adm1026_update_device(dev); 804 struct adm1026_data *data = adm1026_update_device(dev);
812 return sprintf(buf,"%d\n", INS_FROM_REG(16, data->in_min[16]) 805 return sprintf(buf,"%d\n", INS_FROM_REG(16, data->in_min[16])
813 - NEG12_OFFSET); 806 - NEG12_OFFSET);
814} 807}
815static ssize_t set_in16_min(struct device *dev, const char *buf, size_t count) 808static ssize_t set_in16_min(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
816{ 809{
817 struct i2c_client *client = to_i2c_client(dev); 810 struct i2c_client *client = to_i2c_client(dev);
818 struct adm1026_data *data = i2c_get_clientdata(client); 811 struct adm1026_data *data = i2c_get_clientdata(client);
@@ -824,13 +817,13 @@ static ssize_t set_in16_min(struct device *dev, const char *buf, size_t count)
824 up(&data->update_lock); 817 up(&data->update_lock);
825 return count; 818 return count;
826} 819}
827static ssize_t show_in16_max(struct device *dev, char *buf) 820static ssize_t show_in16_max(struct device *dev, struct device_attribute *attr, char *buf)
828{ 821{
829 struct adm1026_data *data = adm1026_update_device(dev); 822 struct adm1026_data *data = adm1026_update_device(dev);
830 return sprintf(buf,"%d\n", INS_FROM_REG(16, data->in_max[16]) 823 return sprintf(buf,"%d\n", INS_FROM_REG(16, data->in_max[16])
831 - NEG12_OFFSET); 824 - NEG12_OFFSET);
832} 825}
833static ssize_t set_in16_max(struct device *dev, const char *buf, size_t count) 826static ssize_t set_in16_max(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
834{ 827{
835 struct i2c_client *client = to_i2c_client(dev); 828 struct i2c_client *client = to_i2c_client(dev);
836 struct adm1026_data *data = i2c_get_clientdata(client); 829 struct adm1026_data *data = i2c_get_clientdata(client);
@@ -843,30 +836,38 @@ static ssize_t set_in16_max(struct device *dev, const char *buf, size_t count)
843 return count; 836 return count;
844} 837}
845 838
846static DEVICE_ATTR(in16_input, S_IRUGO, show_in16, NULL); 839static SENSOR_DEVICE_ATTR(in16_input, S_IRUGO, show_in16, NULL, 16);
847static DEVICE_ATTR(in16_min, S_IRUGO | S_IWUSR, show_in16_min, set_in16_min); 840static SENSOR_DEVICE_ATTR(in16_min, S_IRUGO | S_IWUSR, show_in16_min, set_in16_min, 16);
848static DEVICE_ATTR(in16_max, S_IRUGO | S_IWUSR, show_in16_max, set_in16_max); 841static SENSOR_DEVICE_ATTR(in16_max, S_IRUGO | S_IWUSR, show_in16_max, set_in16_max, 16);
849 842
850 843
851 844
852 845
853/* Now add fan read/write functions */ 846/* Now add fan read/write functions */
854 847
855static ssize_t show_fan(struct device *dev, char *buf, int nr) 848static ssize_t show_fan(struct device *dev, struct device_attribute *attr,
849 char *buf)
856{ 850{
851 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
852 int nr = sensor_attr->index;
857 struct adm1026_data *data = adm1026_update_device(dev); 853 struct adm1026_data *data = adm1026_update_device(dev);
858 return sprintf(buf,"%d\n", FAN_FROM_REG(data->fan[nr], 854 return sprintf(buf,"%d\n", FAN_FROM_REG(data->fan[nr],
859 data->fan_div[nr])); 855 data->fan_div[nr]));
860} 856}
861static ssize_t show_fan_min(struct device *dev, char *buf, int nr) 857static ssize_t show_fan_min(struct device *dev, struct device_attribute *attr,
858 char *buf)
862{ 859{
860 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
861 int nr = sensor_attr->index;
863 struct adm1026_data *data = adm1026_update_device(dev); 862 struct adm1026_data *data = adm1026_update_device(dev);
864 return sprintf(buf,"%d\n", FAN_FROM_REG(data->fan_min[nr], 863 return sprintf(buf,"%d\n", FAN_FROM_REG(data->fan_min[nr],
865 data->fan_div[nr])); 864 data->fan_div[nr]));
866} 865}
867static ssize_t set_fan_min(struct device *dev, const char *buf, 866static ssize_t set_fan_min(struct device *dev, struct device_attribute *attr,
868 size_t count, int nr) 867 const char *buf, size_t count)
869{ 868{
869 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
870 int nr = sensor_attr->index;
870 struct i2c_client *client = to_i2c_client(dev); 871 struct i2c_client *client = to_i2c_client(dev);
871 struct adm1026_data *data = i2c_get_clientdata(client); 872 struct adm1026_data *data = i2c_get_clientdata(client);
872 int val = simple_strtol(buf, NULL, 10); 873 int val = simple_strtol(buf, NULL, 10);
@@ -879,23 +880,11 @@ static ssize_t set_fan_min(struct device *dev, const char *buf,
879 return count; 880 return count;
880} 881}
881 882
882#define fan_offset(offset) \ 883#define fan_offset(offset) \
883static ssize_t show_fan_##offset (struct device *dev, char *buf) \ 884static SENSOR_DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_fan, NULL, \
884{ \ 885 offset - 1); \
885 return show_fan(dev, buf, offset - 1); \ 886static SENSOR_DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR, \
886} \ 887 show_fan_min, set_fan_min, offset - 1);
887static ssize_t show_fan_##offset##_min (struct device *dev, char *buf) \
888{ \
889 return show_fan_min(dev, buf, offset - 1); \
890} \
891static ssize_t set_fan_##offset##_min (struct device *dev, \
892 const char *buf, size_t count) \
893{ \
894 return set_fan_min(dev, buf, count, offset - 1); \
895} \
896static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_fan_##offset, NULL); \
897static DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR, \
898 show_fan_##offset##_min, set_fan_##offset##_min);
899 888
900fan_offset(1); 889fan_offset(1);
901fan_offset(2); 890fan_offset(2);
@@ -926,14 +915,19 @@ static void fixup_fan_min(struct device *dev, int fan, int old_div)
926} 915}
927 916
928/* Now add fan_div read/write functions */ 917/* Now add fan_div read/write functions */
929static ssize_t show_fan_div(struct device *dev, char *buf, int nr) 918static ssize_t show_fan_div(struct device *dev, struct device_attribute *attr,
919 char *buf)
930{ 920{
921 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
922 int nr = sensor_attr->index;
931 struct adm1026_data *data = adm1026_update_device(dev); 923 struct adm1026_data *data = adm1026_update_device(dev);
932 return sprintf(buf,"%d\n", data->fan_div[nr]); 924 return sprintf(buf,"%d\n", data->fan_div[nr]);
933} 925}
934static ssize_t set_fan_div(struct device *dev, const char *buf, 926static ssize_t set_fan_div(struct device *dev, struct device_attribute *attr,
935 size_t count, int nr) 927 const char *buf, size_t count)
936{ 928{
929 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
930 int nr = sensor_attr->index;
937 struct i2c_client *client = to_i2c_client(dev); 931 struct i2c_client *client = to_i2c_client(dev);
938 struct adm1026_data *data = i2c_get_clientdata(client); 932 struct adm1026_data *data = i2c_get_clientdata(client);
939 int val,orig_div,new_div,shift; 933 int val,orig_div,new_div,shift;
@@ -967,17 +961,8 @@ static ssize_t set_fan_div(struct device *dev, const char *buf,
967} 961}
968 962
969#define fan_offset_div(offset) \ 963#define fan_offset_div(offset) \
970static ssize_t show_fan_##offset##_div (struct device *dev, char *buf) \ 964static SENSOR_DEVICE_ATTR(fan##offset##_div, S_IRUGO | S_IWUSR, \
971{ \ 965 show_fan_div, set_fan_div, offset - 1);
972 return show_fan_div(dev, buf, offset - 1); \
973} \
974static ssize_t set_fan_##offset##_div (struct device *dev, \
975 const char *buf, size_t count) \
976{ \
977 return set_fan_div(dev, buf, count, offset - 1); \
978} \
979static DEVICE_ATTR(fan##offset##_div, S_IRUGO | S_IWUSR, \
980 show_fan_##offset##_div, set_fan_##offset##_div);
981 966
982fan_offset_div(1); 967fan_offset_div(1);
983fan_offset_div(2); 968fan_offset_div(2);
@@ -989,19 +974,27 @@ fan_offset_div(7);
989fan_offset_div(8); 974fan_offset_div(8);
990 975
991/* Temps */ 976/* Temps */
992static ssize_t show_temp(struct device *dev, char *buf, int nr) 977static ssize_t show_temp(struct device *dev, struct device_attribute *attr,
978 char *buf)
993{ 979{
980 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
981 int nr = sensor_attr->index;
994 struct adm1026_data *data = adm1026_update_device(dev); 982 struct adm1026_data *data = adm1026_update_device(dev);
995 return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp[nr])); 983 return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp[nr]));
996} 984}
997static ssize_t show_temp_min(struct device *dev, char *buf, int nr) 985static ssize_t show_temp_min(struct device *dev, struct device_attribute *attr,
986 char *buf)
998{ 987{
988 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
989 int nr = sensor_attr->index;
999 struct adm1026_data *data = adm1026_update_device(dev); 990 struct adm1026_data *data = adm1026_update_device(dev);
1000 return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp_min[nr])); 991 return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp_min[nr]));
1001} 992}
1002static ssize_t set_temp_min(struct device *dev, const char *buf, 993static ssize_t set_temp_min(struct device *dev, struct device_attribute *attr,
1003 size_t count, int nr) 994 const char *buf, size_t count)
1004{ 995{
996 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
997 int nr = sensor_attr->index;
1005 struct i2c_client *client = to_i2c_client(dev); 998 struct i2c_client *client = to_i2c_client(dev);
1006 struct adm1026_data *data = i2c_get_clientdata(client); 999 struct adm1026_data *data = i2c_get_clientdata(client);
1007 int val = simple_strtol(buf, NULL, 10); 1000 int val = simple_strtol(buf, NULL, 10);
@@ -1013,14 +1006,19 @@ static ssize_t set_temp_min(struct device *dev, const char *buf,
1013 up(&data->update_lock); 1006 up(&data->update_lock);
1014 return count; 1007 return count;
1015} 1008}
1016static ssize_t show_temp_max(struct device *dev, char *buf, int nr) 1009static ssize_t show_temp_max(struct device *dev, struct device_attribute *attr,
1010 char *buf)
1017{ 1011{
1012 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
1013 int nr = sensor_attr->index;
1018 struct adm1026_data *data = adm1026_update_device(dev); 1014 struct adm1026_data *data = adm1026_update_device(dev);
1019 return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp_max[nr])); 1015 return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp_max[nr]));
1020} 1016}
1021static ssize_t set_temp_max(struct device *dev, const char *buf, 1017static ssize_t set_temp_max(struct device *dev, struct device_attribute *attr,
1022 size_t count, int nr) 1018 const char *buf, size_t count)
1023{ 1019{
1020 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
1021 int nr = sensor_attr->index;
1024 struct i2c_client *client = to_i2c_client(dev); 1022 struct i2c_client *client = to_i2c_client(dev);
1025 struct adm1026_data *data = i2c_get_clientdata(client); 1023 struct adm1026_data *data = i2c_get_clientdata(client);
1026 int val = simple_strtol(buf, NULL, 10); 1024 int val = simple_strtol(buf, NULL, 10);
@@ -1032,48 +1030,34 @@ static ssize_t set_temp_max(struct device *dev, const char *buf,
1032 up(&data->update_lock); 1030 up(&data->update_lock);
1033 return count; 1031 return count;
1034} 1032}
1035#define temp_reg(offset) \ 1033
1036static ssize_t show_temp_##offset (struct device *dev, char *buf) \ 1034#define temp_reg(offset) \
1037{ \ 1035static SENSOR_DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_temp, \
1038 return show_temp(dev, buf, offset - 1); \ 1036 NULL, offset - 1); \
1039} \ 1037static SENSOR_DEVICE_ATTR(temp##offset##_min, S_IRUGO | S_IWUSR, \
1040static ssize_t show_temp_##offset##_min (struct device *dev, char *buf) \ 1038 show_temp_min, set_temp_min, offset - 1); \
1041{ \ 1039static SENSOR_DEVICE_ATTR(temp##offset##_max, S_IRUGO | S_IWUSR, \
1042 return show_temp_min(dev, buf, offset - 1); \ 1040 show_temp_max, set_temp_max, offset - 1);
1043} \
1044static ssize_t show_temp_##offset##_max (struct device *dev, char *buf) \
1045{ \
1046 return show_temp_max(dev, buf, offset - 1); \
1047} \
1048static ssize_t set_temp_##offset##_min (struct device *dev, \
1049 const char *buf, size_t count) \
1050{ \
1051 return set_temp_min(dev, buf, count, offset - 1); \
1052} \
1053static ssize_t set_temp_##offset##_max (struct device *dev, \
1054 const char *buf, size_t count) \
1055{ \
1056 return set_temp_max(dev, buf, count, offset - 1); \
1057} \
1058static DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_temp_##offset, NULL); \
1059static DEVICE_ATTR(temp##offset##_min, S_IRUGO | S_IWUSR, \
1060 show_temp_##offset##_min, set_temp_##offset##_min); \
1061static DEVICE_ATTR(temp##offset##_max, S_IRUGO | S_IWUSR, \
1062 show_temp_##offset##_max, set_temp_##offset##_max);
1063 1041
1064 1042
1065temp_reg(1); 1043temp_reg(1);
1066temp_reg(2); 1044temp_reg(2);
1067temp_reg(3); 1045temp_reg(3);
1068 1046
1069static ssize_t show_temp_offset(struct device *dev, char *buf, int nr) 1047static ssize_t show_temp_offset(struct device *dev,
1048 struct device_attribute *attr, char *buf)
1070{ 1049{
1050 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
1051 int nr = sensor_attr->index;
1071 struct adm1026_data *data = adm1026_update_device(dev); 1052 struct adm1026_data *data = adm1026_update_device(dev);
1072 return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp_offset[nr])); 1053 return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp_offset[nr]));
1073} 1054}
1074static ssize_t set_temp_offset(struct device *dev, const char *buf, 1055static ssize_t set_temp_offset(struct device *dev,
1075 size_t count, int nr) 1056 struct device_attribute *attr, const char *buf,
1057 size_t count)
1076{ 1058{
1059 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
1060 int nr = sensor_attr->index;
1077 struct i2c_client *client = to_i2c_client(dev); 1061 struct i2c_client *client = to_i2c_client(dev);
1078 struct adm1026_data *data = i2c_get_clientdata(client); 1062 struct adm1026_data *data = i2c_get_clientdata(client);
1079 int val = simple_strtol(buf, NULL, 10); 1063 int val = simple_strtol(buf, NULL, 10);
@@ -1086,46 +1070,45 @@ static ssize_t set_temp_offset(struct device *dev, const char *buf,
1086 return count; 1070 return count;
1087} 1071}
1088 1072
1089#define temp_offset_reg(offset) \ 1073#define temp_offset_reg(offset) \
1090static ssize_t show_temp_##offset##_offset (struct device *dev, char *buf) \ 1074static SENSOR_DEVICE_ATTR(temp##offset##_offset, S_IRUGO | S_IWUSR, \
1091{ \ 1075 show_temp_offset, set_temp_offset, offset - 1);
1092 return show_temp_offset(dev, buf, offset - 1); \
1093} \
1094static ssize_t set_temp_##offset##_offset (struct device *dev, \
1095 const char *buf, size_t count) \
1096{ \
1097 return set_temp_offset(dev, buf, count, offset - 1); \
1098} \
1099static DEVICE_ATTR(temp##offset##_offset, S_IRUGO | S_IWUSR, \
1100 show_temp_##offset##_offset, set_temp_##offset##_offset);
1101 1076
1102temp_offset_reg(1); 1077temp_offset_reg(1);
1103temp_offset_reg(2); 1078temp_offset_reg(2);
1104temp_offset_reg(3); 1079temp_offset_reg(3);
1105 1080
1106static ssize_t show_temp_auto_point1_temp_hyst(struct device *dev, char *buf, 1081static ssize_t show_temp_auto_point1_temp_hyst(struct device *dev,
1107 int nr) 1082 struct device_attribute *attr, char *buf)
1108{ 1083{
1084 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
1085 int nr = sensor_attr->index;
1109 struct adm1026_data *data = adm1026_update_device(dev); 1086 struct adm1026_data *data = adm1026_update_device(dev);
1110 return sprintf(buf,"%d\n", TEMP_FROM_REG( 1087 return sprintf(buf,"%d\n", TEMP_FROM_REG(
1111 ADM1026_FAN_ACTIVATION_TEMP_HYST + data->temp_tmin[nr])); 1088 ADM1026_FAN_ACTIVATION_TEMP_HYST + data->temp_tmin[nr]));
1112} 1089}
1113static ssize_t show_temp_auto_point2_temp(struct device *dev, char *buf, 1090static ssize_t show_temp_auto_point2_temp(struct device *dev,
1114 int nr) 1091 struct device_attribute *attr, char *buf)
1115{ 1092{
1093 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
1094 int nr = sensor_attr->index;
1116 struct adm1026_data *data = adm1026_update_device(dev); 1095 struct adm1026_data *data = adm1026_update_device(dev);
1117 return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp_tmin[nr] + 1096 return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp_tmin[nr] +
1118 ADM1026_FAN_CONTROL_TEMP_RANGE)); 1097 ADM1026_FAN_CONTROL_TEMP_RANGE));
1119} 1098}
1120static ssize_t show_temp_auto_point1_temp(struct device *dev, char *buf, 1099static ssize_t show_temp_auto_point1_temp(struct device *dev,
1121 int nr) 1100 struct device_attribute *attr, char *buf)
1122{ 1101{
1102 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
1103 int nr = sensor_attr->index;
1123 struct adm1026_data *data = adm1026_update_device(dev); 1104 struct adm1026_data *data = adm1026_update_device(dev);
1124 return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp_tmin[nr])); 1105 return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp_tmin[nr]));
1125} 1106}
1126static ssize_t set_temp_auto_point1_temp(struct device *dev, const char *buf, 1107static ssize_t set_temp_auto_point1_temp(struct device *dev,
1127 size_t count, int nr) 1108 struct device_attribute *attr, const char *buf, size_t count)
1128{ 1109{
1110 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
1111 int nr = sensor_attr->index;
1129 struct i2c_client *client = to_i2c_client(dev); 1112 struct i2c_client *client = to_i2c_client(dev);
1130 struct adm1026_data *data = i2c_get_clientdata(client); 1113 struct adm1026_data *data = i2c_get_clientdata(client);
1131 int val = simple_strtol(buf, NULL, 10); 1114 int val = simple_strtol(buf, NULL, 10);
@@ -1138,46 +1121,27 @@ static ssize_t set_temp_auto_point1_temp(struct device *dev, const char *buf,
1138 return count; 1121 return count;
1139} 1122}
1140 1123
1141#define temp_auto_point(offset) \ 1124#define temp_auto_point(offset) \
1142static ssize_t show_temp##offset##_auto_point1_temp (struct device *dev, \ 1125static SENSOR_DEVICE_ATTR(temp##offset##_auto_point1_temp, S_IRUGO | S_IWUSR, \
1143 char *buf) \ 1126 show_temp_auto_point1_temp, set_temp_auto_point1_temp, \
1144{ \ 1127 offset - 1); \
1145 return show_temp_auto_point1_temp(dev, buf, offset - 1); \ 1128static SENSOR_DEVICE_ATTR(temp##offset##_auto_point1_temp_hyst, S_IRUGO, \
1146} \ 1129 show_temp_auto_point1_temp_hyst, NULL, offset - 1); \
1147static ssize_t set_temp##offset##_auto_point1_temp (struct device *dev, \ 1130static SENSOR_DEVICE_ATTR(temp##offset##_auto_point2_temp, S_IRUGO, \
1148 const char *buf, size_t count) \ 1131 show_temp_auto_point2_temp, NULL, offset - 1);
1149{ \
1150 return set_temp_auto_point1_temp(dev, buf, count, offset - 1); \
1151} \
1152static ssize_t show_temp##offset##_auto_point1_temp_hyst (struct device \
1153 *dev, char *buf) \
1154{ \
1155 return show_temp_auto_point1_temp_hyst(dev, buf, offset - 1); \
1156} \
1157static ssize_t show_temp##offset##_auto_point2_temp (struct device *dev, \
1158 char *buf) \
1159{ \
1160 return show_temp_auto_point2_temp(dev, buf, offset - 1); \
1161} \
1162static DEVICE_ATTR(temp##offset##_auto_point1_temp, S_IRUGO | S_IWUSR, \
1163 show_temp##offset##_auto_point1_temp, \
1164 set_temp##offset##_auto_point1_temp); \
1165static DEVICE_ATTR(temp##offset##_auto_point1_temp_hyst, S_IRUGO, \
1166 show_temp##offset##_auto_point1_temp_hyst, NULL); \
1167static DEVICE_ATTR(temp##offset##_auto_point2_temp, S_IRUGO, \
1168 show_temp##offset##_auto_point2_temp, NULL);
1169 1132
1170temp_auto_point(1); 1133temp_auto_point(1);
1171temp_auto_point(2); 1134temp_auto_point(2);
1172temp_auto_point(3); 1135temp_auto_point(3);
1173 1136
1174static ssize_t show_temp_crit_enable(struct device *dev, char *buf) 1137static ssize_t show_temp_crit_enable(struct device *dev,
1138 struct device_attribute *attr, char *buf)
1175{ 1139{
1176 struct adm1026_data *data = adm1026_update_device(dev); 1140 struct adm1026_data *data = adm1026_update_device(dev);
1177 return sprintf(buf,"%d\n", (data->config1 & CFG1_THERM_HOT) >> 4); 1141 return sprintf(buf,"%d\n", (data->config1 & CFG1_THERM_HOT) >> 4);
1178} 1142}
1179static ssize_t set_temp_crit_enable(struct device *dev, const char *buf, 1143static ssize_t set_temp_crit_enable(struct device *dev,
1180 size_t count) 1144 struct device_attribute *attr, const char *buf, size_t count)
1181{ 1145{
1182 struct i2c_client *client = to_i2c_client(dev); 1146 struct i2c_client *client = to_i2c_client(dev);
1183 struct adm1026_data *data = i2c_get_clientdata(client); 1147 struct adm1026_data *data = i2c_get_clientdata(client);
@@ -1193,24 +1157,27 @@ static ssize_t set_temp_crit_enable(struct device *dev, const char *buf,
1193 return count; 1157 return count;
1194} 1158}
1195 1159
1196static DEVICE_ATTR(temp1_crit_enable, S_IRUGO | S_IWUSR, 1160#define temp_crit_enable(offset) \
1197 show_temp_crit_enable, set_temp_crit_enable); 1161static DEVICE_ATTR(temp##offset##_crit_enable, S_IRUGO | S_IWUSR, \
1198
1199static DEVICE_ATTR(temp2_crit_enable, S_IRUGO | S_IWUSR,
1200 show_temp_crit_enable, set_temp_crit_enable);
1201
1202static DEVICE_ATTR(temp3_crit_enable, S_IRUGO | S_IWUSR,
1203 show_temp_crit_enable, set_temp_crit_enable); 1162 show_temp_crit_enable, set_temp_crit_enable);
1204 1163
1164temp_crit_enable(1);
1165temp_crit_enable(2);
1166temp_crit_enable(3);
1205 1167
1206static ssize_t show_temp_crit(struct device *dev, char *buf, int nr) 1168static ssize_t show_temp_crit(struct device *dev,
1169 struct device_attribute *attr, char *buf)
1207{ 1170{
1171 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
1172 int nr = sensor_attr->index;
1208 struct adm1026_data *data = adm1026_update_device(dev); 1173 struct adm1026_data *data = adm1026_update_device(dev);
1209 return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp_crit[nr])); 1174 return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp_crit[nr]));
1210} 1175}
1211static ssize_t set_temp_crit(struct device *dev, const char *buf, 1176static ssize_t set_temp_crit(struct device *dev, struct device_attribute *attr,
1212 size_t count, int nr) 1177 const char *buf, size_t count)
1213{ 1178{
1179 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
1180 int nr = sensor_attr->index;
1214 struct i2c_client *client = to_i2c_client(dev); 1181 struct i2c_client *client = to_i2c_client(dev);
1215 struct adm1026_data *data = i2c_get_clientdata(client); 1182 struct adm1026_data *data = i2c_get_clientdata(client);
1216 int val = simple_strtol(buf, NULL, 10); 1183 int val = simple_strtol(buf, NULL, 10);
@@ -1223,29 +1190,20 @@ static ssize_t set_temp_crit(struct device *dev, const char *buf,
1223 return count; 1190 return count;
1224} 1191}
1225 1192
1226#define temp_crit_reg(offset) \ 1193#define temp_crit_reg(offset) \
1227static ssize_t show_temp_##offset##_crit (struct device *dev, char *buf) \ 1194static SENSOR_DEVICE_ATTR(temp##offset##_crit, S_IRUGO | S_IWUSR, \
1228{ \ 1195 show_temp_crit, set_temp_crit, offset - 1);
1229 return show_temp_crit(dev, buf, offset - 1); \
1230} \
1231static ssize_t set_temp_##offset##_crit (struct device *dev, \
1232 const char *buf, size_t count) \
1233{ \
1234 return set_temp_crit(dev, buf, count, offset - 1); \
1235} \
1236static DEVICE_ATTR(temp##offset##_crit, S_IRUGO | S_IWUSR, \
1237 show_temp_##offset##_crit, set_temp_##offset##_crit);
1238 1196
1239temp_crit_reg(1); 1197temp_crit_reg(1);
1240temp_crit_reg(2); 1198temp_crit_reg(2);
1241temp_crit_reg(3); 1199temp_crit_reg(3);
1242 1200
1243static ssize_t show_analog_out_reg(struct device *dev, char *buf) 1201static ssize_t show_analog_out_reg(struct device *dev, struct device_attribute *attr, char *buf)
1244{ 1202{
1245 struct adm1026_data *data = adm1026_update_device(dev); 1203 struct adm1026_data *data = adm1026_update_device(dev);
1246 return sprintf(buf,"%d\n", DAC_FROM_REG(data->analog_out)); 1204 return sprintf(buf,"%d\n", DAC_FROM_REG(data->analog_out));
1247} 1205}
1248static ssize_t set_analog_out_reg(struct device *dev, const char *buf, 1206static ssize_t set_analog_out_reg(struct device *dev, struct device_attribute *attr, const char *buf,
1249 size_t count) 1207 size_t count)
1250{ 1208{
1251 struct i2c_client *client = to_i2c_client(dev); 1209 struct i2c_client *client = to_i2c_client(dev);
@@ -1262,7 +1220,7 @@ static ssize_t set_analog_out_reg(struct device *dev, const char *buf,
1262static DEVICE_ATTR(analog_out, S_IRUGO | S_IWUSR, show_analog_out_reg, 1220static DEVICE_ATTR(analog_out, S_IRUGO | S_IWUSR, show_analog_out_reg,
1263 set_analog_out_reg); 1221 set_analog_out_reg);
1264 1222
1265static ssize_t show_vid_reg(struct device *dev, char *buf) 1223static ssize_t show_vid_reg(struct device *dev, struct device_attribute *attr, char *buf)
1266{ 1224{
1267 struct adm1026_data *data = adm1026_update_device(dev); 1225 struct adm1026_data *data = adm1026_update_device(dev);
1268 return sprintf(buf,"%d\n", vid_from_reg(data->vid & 0x3f, data->vrm)); 1226 return sprintf(buf,"%d\n", vid_from_reg(data->vid & 0x3f, data->vrm));
@@ -1270,12 +1228,12 @@ static ssize_t show_vid_reg(struct device *dev, char *buf)
1270 1228
1271static DEVICE_ATTR(vid, S_IRUGO, show_vid_reg, NULL); 1229static DEVICE_ATTR(vid, S_IRUGO, show_vid_reg, NULL);
1272 1230
1273static ssize_t show_vrm_reg(struct device *dev, char *buf) 1231static ssize_t show_vrm_reg(struct device *dev, struct device_attribute *attr, char *buf)
1274{ 1232{
1275 struct adm1026_data *data = adm1026_update_device(dev); 1233 struct adm1026_data *data = adm1026_update_device(dev);
1276 return sprintf(buf,"%d\n", data->vrm); 1234 return sprintf(buf,"%d\n", data->vrm);
1277} 1235}
1278static ssize_t store_vrm_reg(struct device *dev, const char *buf, 1236static ssize_t store_vrm_reg(struct device *dev, struct device_attribute *attr, const char *buf,
1279 size_t count) 1237 size_t count)
1280{ 1238{
1281 struct i2c_client *client = to_i2c_client(dev); 1239 struct i2c_client *client = to_i2c_client(dev);
@@ -1287,7 +1245,7 @@ static ssize_t store_vrm_reg(struct device *dev, const char *buf,
1287 1245
1288static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm_reg, store_vrm_reg); 1246static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm_reg, store_vrm_reg);
1289 1247
1290static ssize_t show_alarms_reg(struct device *dev, char *buf) 1248static ssize_t show_alarms_reg(struct device *dev, struct device_attribute *attr, char *buf)
1291{ 1249{
1292 struct adm1026_data *data = adm1026_update_device(dev); 1250 struct adm1026_data *data = adm1026_update_device(dev);
1293 return sprintf(buf, "%ld\n", (long) (data->alarms)); 1251 return sprintf(buf, "%ld\n", (long) (data->alarms));
@@ -1295,12 +1253,12 @@ static ssize_t show_alarms_reg(struct device *dev, char *buf)
1295 1253
1296static DEVICE_ATTR(alarms, S_IRUGO, show_alarms_reg, NULL); 1254static DEVICE_ATTR(alarms, S_IRUGO, show_alarms_reg, NULL);
1297 1255
1298static ssize_t show_alarm_mask(struct device *dev, char *buf) 1256static ssize_t show_alarm_mask(struct device *dev, struct device_attribute *attr, char *buf)
1299{ 1257{
1300 struct adm1026_data *data = adm1026_update_device(dev); 1258 struct adm1026_data *data = adm1026_update_device(dev);
1301 return sprintf(buf,"%ld\n", data->alarm_mask); 1259 return sprintf(buf,"%ld\n", data->alarm_mask);
1302} 1260}
1303static ssize_t set_alarm_mask(struct device *dev, const char *buf, 1261static ssize_t set_alarm_mask(struct device *dev, struct device_attribute *attr, const char *buf,
1304 size_t count) 1262 size_t count)
1305{ 1263{
1306 struct i2c_client *client = to_i2c_client(dev); 1264 struct i2c_client *client = to_i2c_client(dev);
@@ -1331,12 +1289,12 @@ static DEVICE_ATTR(alarm_mask, S_IRUGO | S_IWUSR, show_alarm_mask,
1331 set_alarm_mask); 1289 set_alarm_mask);
1332 1290
1333 1291
1334static ssize_t show_gpio(struct device *dev, char *buf) 1292static ssize_t show_gpio(struct device *dev, struct device_attribute *attr, char *buf)
1335{ 1293{
1336 struct adm1026_data *data = adm1026_update_device(dev); 1294 struct adm1026_data *data = adm1026_update_device(dev);
1337 return sprintf(buf,"%ld\n", data->gpio); 1295 return sprintf(buf,"%ld\n", data->gpio);
1338} 1296}
1339static ssize_t set_gpio(struct device *dev, const char *buf, 1297static ssize_t set_gpio(struct device *dev, struct device_attribute *attr, const char *buf,
1340 size_t count) 1298 size_t count)
1341{ 1299{
1342 struct i2c_client *client = to_i2c_client(dev); 1300 struct i2c_client *client = to_i2c_client(dev);
@@ -1359,12 +1317,12 @@ static ssize_t set_gpio(struct device *dev, const char *buf,
1359static DEVICE_ATTR(gpio, S_IRUGO | S_IWUSR, show_gpio, set_gpio); 1317static DEVICE_ATTR(gpio, S_IRUGO | S_IWUSR, show_gpio, set_gpio);
1360 1318
1361 1319
1362static ssize_t show_gpio_mask(struct device *dev, char *buf) 1320static ssize_t show_gpio_mask(struct device *dev, struct device_attribute *attr, char *buf)
1363{ 1321{
1364 struct adm1026_data *data = adm1026_update_device(dev); 1322 struct adm1026_data *data = adm1026_update_device(dev);
1365 return sprintf(buf,"%ld\n", data->gpio_mask); 1323 return sprintf(buf,"%ld\n", data->gpio_mask);
1366} 1324}
1367static ssize_t set_gpio_mask(struct device *dev, const char *buf, 1325static ssize_t set_gpio_mask(struct device *dev, struct device_attribute *attr, const char *buf,
1368 size_t count) 1326 size_t count)
1369{ 1327{
1370 struct i2c_client *client = to_i2c_client(dev); 1328 struct i2c_client *client = to_i2c_client(dev);
@@ -1386,12 +1344,12 @@ static ssize_t set_gpio_mask(struct device *dev, const char *buf,
1386 1344
1387static DEVICE_ATTR(gpio_mask, S_IRUGO | S_IWUSR, show_gpio_mask, set_gpio_mask); 1345static DEVICE_ATTR(gpio_mask, S_IRUGO | S_IWUSR, show_gpio_mask, set_gpio_mask);
1388 1346
1389static ssize_t show_pwm_reg(struct device *dev, char *buf) 1347static ssize_t show_pwm_reg(struct device *dev, struct device_attribute *attr, char *buf)
1390{ 1348{
1391 struct adm1026_data *data = adm1026_update_device(dev); 1349 struct adm1026_data *data = adm1026_update_device(dev);
1392 return sprintf(buf,"%d\n", PWM_FROM_REG(data->pwm1.pwm)); 1350 return sprintf(buf,"%d\n", PWM_FROM_REG(data->pwm1.pwm));
1393} 1351}
1394static ssize_t set_pwm_reg(struct device *dev, const char *buf, 1352static ssize_t set_pwm_reg(struct device *dev, struct device_attribute *attr, const char *buf,
1395 size_t count) 1353 size_t count)
1396{ 1354{
1397 struct i2c_client *client = to_i2c_client(dev); 1355 struct i2c_client *client = to_i2c_client(dev);
@@ -1407,12 +1365,12 @@ static ssize_t set_pwm_reg(struct device *dev, const char *buf,
1407 } 1365 }
1408 return count; 1366 return count;
1409} 1367}
1410static ssize_t show_auto_pwm_min(struct device *dev, char *buf) 1368static ssize_t show_auto_pwm_min(struct device *dev, struct device_attribute *attr, char *buf)
1411{ 1369{
1412 struct adm1026_data *data = adm1026_update_device(dev); 1370 struct adm1026_data *data = adm1026_update_device(dev);
1413 return sprintf(buf,"%d\n", data->pwm1.auto_pwm_min); 1371 return sprintf(buf,"%d\n", data->pwm1.auto_pwm_min);
1414} 1372}
1415static ssize_t set_auto_pwm_min(struct device *dev, const char *buf, 1373static ssize_t set_auto_pwm_min(struct device *dev, struct device_attribute *attr, const char *buf,
1416 size_t count) 1374 size_t count)
1417{ 1375{
1418 struct i2c_client *client = to_i2c_client(dev); 1376 struct i2c_client *client = to_i2c_client(dev);
@@ -1429,16 +1387,16 @@ static ssize_t set_auto_pwm_min(struct device *dev, const char *buf,
1429 up(&data->update_lock); 1387 up(&data->update_lock);
1430 return count; 1388 return count;
1431} 1389}
1432static ssize_t show_auto_pwm_max(struct device *dev, char *buf) 1390static ssize_t show_auto_pwm_max(struct device *dev, struct device_attribute *attr, char *buf)
1433{ 1391{
1434 return sprintf(buf,"%d\n", ADM1026_PWM_MAX); 1392 return sprintf(buf,"%d\n", ADM1026_PWM_MAX);
1435} 1393}
1436static ssize_t show_pwm_enable(struct device *dev, char *buf) 1394static ssize_t show_pwm_enable(struct device *dev, struct device_attribute *attr, char *buf)
1437{ 1395{
1438 struct adm1026_data *data = adm1026_update_device(dev); 1396 struct adm1026_data *data = adm1026_update_device(dev);
1439 return sprintf(buf,"%d\n", data->pwm1.enable); 1397 return sprintf(buf,"%d\n", data->pwm1.enable);
1440} 1398}
1441static ssize_t set_pwm_enable(struct device *dev, const char *buf, 1399static ssize_t set_pwm_enable(struct device *dev, struct device_attribute *attr, const char *buf,
1442 size_t count) 1400 size_t count)
1443{ 1401{
1444 struct i2c_client *client = to_i2c_client(dev); 1402 struct i2c_client *client = to_i2c_client(dev);
@@ -1597,114 +1555,114 @@ int adm1026_detect(struct i2c_adapter *adapter, int address,
1597 adm1026_init_client(new_client); 1555 adm1026_init_client(new_client);
1598 1556
1599 /* Register sysfs hooks */ 1557 /* Register sysfs hooks */
1600 device_create_file(&new_client->dev, &dev_attr_in0_input); 1558 device_create_file(&new_client->dev, &sensor_dev_attr_in0_input.dev_attr);
1601 device_create_file(&new_client->dev, &dev_attr_in0_max); 1559 device_create_file(&new_client->dev, &sensor_dev_attr_in0_max.dev_attr);
1602 device_create_file(&new_client->dev, &dev_attr_in0_min); 1560 device_create_file(&new_client->dev, &sensor_dev_attr_in0_min.dev_attr);
1603 device_create_file(&new_client->dev, &dev_attr_in1_input); 1561 device_create_file(&new_client->dev, &sensor_dev_attr_in1_input.dev_attr);
1604 device_create_file(&new_client->dev, &dev_attr_in1_max); 1562 device_create_file(&new_client->dev, &sensor_dev_attr_in1_max.dev_attr);
1605 device_create_file(&new_client->dev, &dev_attr_in1_min); 1563 device_create_file(&new_client->dev, &sensor_dev_attr_in1_min.dev_attr);
1606 device_create_file(&new_client->dev, &dev_attr_in2_input); 1564 device_create_file(&new_client->dev, &sensor_dev_attr_in2_input.dev_attr);
1607 device_create_file(&new_client->dev, &dev_attr_in2_max); 1565 device_create_file(&new_client->dev, &sensor_dev_attr_in2_max.dev_attr);
1608 device_create_file(&new_client->dev, &dev_attr_in2_min); 1566 device_create_file(&new_client->dev, &sensor_dev_attr_in2_min.dev_attr);
1609 device_create_file(&new_client->dev, &dev_attr_in3_input); 1567 device_create_file(&new_client->dev, &sensor_dev_attr_in3_input.dev_attr);
1610 device_create_file(&new_client->dev, &dev_attr_in3_max); 1568 device_create_file(&new_client->dev, &sensor_dev_attr_in3_max.dev_attr);
1611 device_create_file(&new_client->dev, &dev_attr_in3_min); 1569 device_create_file(&new_client->dev, &sensor_dev_attr_in3_min.dev_attr);
1612 device_create_file(&new_client->dev, &dev_attr_in4_input); 1570 device_create_file(&new_client->dev, &sensor_dev_attr_in4_input.dev_attr);
1613 device_create_file(&new_client->dev, &dev_attr_in4_max); 1571 device_create_file(&new_client->dev, &sensor_dev_attr_in4_max.dev_attr);
1614 device_create_file(&new_client->dev, &dev_attr_in4_min); 1572 device_create_file(&new_client->dev, &sensor_dev_attr_in4_min.dev_attr);
1615 device_create_file(&new_client->dev, &dev_attr_in5_input); 1573 device_create_file(&new_client->dev, &sensor_dev_attr_in5_input.dev_attr);
1616 device_create_file(&new_client->dev, &dev_attr_in5_max); 1574 device_create_file(&new_client->dev, &sensor_dev_attr_in5_max.dev_attr);
1617 device_create_file(&new_client->dev, &dev_attr_in5_min); 1575 device_create_file(&new_client->dev, &sensor_dev_attr_in5_min.dev_attr);
1618 device_create_file(&new_client->dev, &dev_attr_in6_input); 1576 device_create_file(&new_client->dev, &sensor_dev_attr_in6_input.dev_attr);
1619 device_create_file(&new_client->dev, &dev_attr_in6_max); 1577 device_create_file(&new_client->dev, &sensor_dev_attr_in6_max.dev_attr);
1620 device_create_file(&new_client->dev, &dev_attr_in6_min); 1578 device_create_file(&new_client->dev, &sensor_dev_attr_in6_min.dev_attr);
1621 device_create_file(&new_client->dev, &dev_attr_in7_input); 1579 device_create_file(&new_client->dev, &sensor_dev_attr_in7_input.dev_attr);
1622 device_create_file(&new_client->dev, &dev_attr_in7_max); 1580 device_create_file(&new_client->dev, &sensor_dev_attr_in7_max.dev_attr);
1623 device_create_file(&new_client->dev, &dev_attr_in7_min); 1581 device_create_file(&new_client->dev, &sensor_dev_attr_in7_min.dev_attr);
1624 device_create_file(&new_client->dev, &dev_attr_in8_input); 1582 device_create_file(&new_client->dev, &sensor_dev_attr_in8_input.dev_attr);
1625 device_create_file(&new_client->dev, &dev_attr_in8_max); 1583 device_create_file(&new_client->dev, &sensor_dev_attr_in8_max.dev_attr);
1626 device_create_file(&new_client->dev, &dev_attr_in8_min); 1584 device_create_file(&new_client->dev, &sensor_dev_attr_in8_min.dev_attr);
1627 device_create_file(&new_client->dev, &dev_attr_in9_input); 1585 device_create_file(&new_client->dev, &sensor_dev_attr_in9_input.dev_attr);
1628 device_create_file(&new_client->dev, &dev_attr_in9_max); 1586 device_create_file(&new_client->dev, &sensor_dev_attr_in9_max.dev_attr);
1629 device_create_file(&new_client->dev, &dev_attr_in9_min); 1587 device_create_file(&new_client->dev, &sensor_dev_attr_in9_min.dev_attr);
1630 device_create_file(&new_client->dev, &dev_attr_in10_input); 1588 device_create_file(&new_client->dev, &sensor_dev_attr_in10_input.dev_attr);
1631 device_create_file(&new_client->dev, &dev_attr_in10_max); 1589 device_create_file(&new_client->dev, &sensor_dev_attr_in10_max.dev_attr);
1632 device_create_file(&new_client->dev, &dev_attr_in10_min); 1590 device_create_file(&new_client->dev, &sensor_dev_attr_in10_min.dev_attr);
1633 device_create_file(&new_client->dev, &dev_attr_in11_input); 1591 device_create_file(&new_client->dev, &sensor_dev_attr_in11_input.dev_attr);
1634 device_create_file(&new_client->dev, &dev_attr_in11_max); 1592 device_create_file(&new_client->dev, &sensor_dev_attr_in11_max.dev_attr);
1635 device_create_file(&new_client->dev, &dev_attr_in11_min); 1593 device_create_file(&new_client->dev, &sensor_dev_attr_in11_min.dev_attr);
1636 device_create_file(&new_client->dev, &dev_attr_in12_input); 1594 device_create_file(&new_client->dev, &sensor_dev_attr_in12_input.dev_attr);
1637 device_create_file(&new_client->dev, &dev_attr_in12_max); 1595 device_create_file(&new_client->dev, &sensor_dev_attr_in12_max.dev_attr);
1638 device_create_file(&new_client->dev, &dev_attr_in12_min); 1596 device_create_file(&new_client->dev, &sensor_dev_attr_in12_min.dev_attr);
1639 device_create_file(&new_client->dev, &dev_attr_in13_input); 1597 device_create_file(&new_client->dev, &sensor_dev_attr_in13_input.dev_attr);
1640 device_create_file(&new_client->dev, &dev_attr_in13_max); 1598 device_create_file(&new_client->dev, &sensor_dev_attr_in13_max.dev_attr);
1641 device_create_file(&new_client->dev, &dev_attr_in13_min); 1599 device_create_file(&new_client->dev, &sensor_dev_attr_in13_min.dev_attr);
1642 device_create_file(&new_client->dev, &dev_attr_in14_input); 1600 device_create_file(&new_client->dev, &sensor_dev_attr_in14_input.dev_attr);
1643 device_create_file(&new_client->dev, &dev_attr_in14_max); 1601 device_create_file(&new_client->dev, &sensor_dev_attr_in14_max.dev_attr);
1644 device_create_file(&new_client->dev, &dev_attr_in14_min); 1602 device_create_file(&new_client->dev, &sensor_dev_attr_in14_min.dev_attr);
1645 device_create_file(&new_client->dev, &dev_attr_in15_input); 1603 device_create_file(&new_client->dev, &sensor_dev_attr_in15_input.dev_attr);
1646 device_create_file(&new_client->dev, &dev_attr_in15_max); 1604 device_create_file(&new_client->dev, &sensor_dev_attr_in15_max.dev_attr);
1647 device_create_file(&new_client->dev, &dev_attr_in15_min); 1605 device_create_file(&new_client->dev, &sensor_dev_attr_in15_min.dev_attr);
1648 device_create_file(&new_client->dev, &dev_attr_in16_input); 1606 device_create_file(&new_client->dev, &sensor_dev_attr_in16_input.dev_attr);
1649 device_create_file(&new_client->dev, &dev_attr_in16_max); 1607 device_create_file(&new_client->dev, &sensor_dev_attr_in16_max.dev_attr);
1650 device_create_file(&new_client->dev, &dev_attr_in16_min); 1608 device_create_file(&new_client->dev, &sensor_dev_attr_in16_min.dev_attr);
1651 device_create_file(&new_client->dev, &dev_attr_fan1_input); 1609 device_create_file(&new_client->dev, &sensor_dev_attr_fan1_input.dev_attr);
1652 device_create_file(&new_client->dev, &dev_attr_fan1_div); 1610 device_create_file(&new_client->dev, &sensor_dev_attr_fan1_div.dev_attr);
1653 device_create_file(&new_client->dev, &dev_attr_fan1_min); 1611 device_create_file(&new_client->dev, &sensor_dev_attr_fan1_min.dev_attr);
1654 device_create_file(&new_client->dev, &dev_attr_fan2_input); 1612 device_create_file(&new_client->dev, &sensor_dev_attr_fan2_input.dev_attr);
1655 device_create_file(&new_client->dev, &dev_attr_fan2_div); 1613 device_create_file(&new_client->dev, &sensor_dev_attr_fan2_div.dev_attr);
1656 device_create_file(&new_client->dev, &dev_attr_fan2_min); 1614 device_create_file(&new_client->dev, &sensor_dev_attr_fan2_min.dev_attr);
1657 device_create_file(&new_client->dev, &dev_attr_fan3_input); 1615 device_create_file(&new_client->dev, &sensor_dev_attr_fan3_input.dev_attr);
1658 device_create_file(&new_client->dev, &dev_attr_fan3_div); 1616 device_create_file(&new_client->dev, &sensor_dev_attr_fan3_div.dev_attr);
1659 device_create_file(&new_client->dev, &dev_attr_fan3_min); 1617 device_create_file(&new_client->dev, &sensor_dev_attr_fan3_min.dev_attr);
1660 device_create_file(&new_client->dev, &dev_attr_fan4_input); 1618 device_create_file(&new_client->dev, &sensor_dev_attr_fan4_input.dev_attr);
1661 device_create_file(&new_client->dev, &dev_attr_fan4_div); 1619 device_create_file(&new_client->dev, &sensor_dev_attr_fan4_div.dev_attr);
1662 device_create_file(&new_client->dev, &dev_attr_fan4_min); 1620 device_create_file(&new_client->dev, &sensor_dev_attr_fan4_min.dev_attr);
1663 device_create_file(&new_client->dev, &dev_attr_fan5_input); 1621 device_create_file(&new_client->dev, &sensor_dev_attr_fan5_input.dev_attr);
1664 device_create_file(&new_client->dev, &dev_attr_fan5_div); 1622 device_create_file(&new_client->dev, &sensor_dev_attr_fan5_div.dev_attr);
1665 device_create_file(&new_client->dev, &dev_attr_fan5_min); 1623 device_create_file(&new_client->dev, &sensor_dev_attr_fan5_min.dev_attr);
1666 device_create_file(&new_client->dev, &dev_attr_fan6_input); 1624 device_create_file(&new_client->dev, &sensor_dev_attr_fan6_input.dev_attr);
1667 device_create_file(&new_client->dev, &dev_attr_fan6_div); 1625 device_create_file(&new_client->dev, &sensor_dev_attr_fan6_div.dev_attr);
1668 device_create_file(&new_client->dev, &dev_attr_fan6_min); 1626 device_create_file(&new_client->dev, &sensor_dev_attr_fan6_min.dev_attr);
1669 device_create_file(&new_client->dev, &dev_attr_fan7_input); 1627 device_create_file(&new_client->dev, &sensor_dev_attr_fan7_input.dev_attr);
1670 device_create_file(&new_client->dev, &dev_attr_fan7_div); 1628 device_create_file(&new_client->dev, &sensor_dev_attr_fan7_div.dev_attr);
1671 device_create_file(&new_client->dev, &dev_attr_fan7_min); 1629 device_create_file(&new_client->dev, &sensor_dev_attr_fan7_min.dev_attr);
1672 device_create_file(&new_client->dev, &dev_attr_fan8_input); 1630 device_create_file(&new_client->dev, &sensor_dev_attr_fan8_input.dev_attr);
1673 device_create_file(&new_client->dev, &dev_attr_fan8_div); 1631 device_create_file(&new_client->dev, &sensor_dev_attr_fan8_div.dev_attr);
1674 device_create_file(&new_client->dev, &dev_attr_fan8_min); 1632 device_create_file(&new_client->dev, &sensor_dev_attr_fan8_min.dev_attr);
1675 device_create_file(&new_client->dev, &dev_attr_temp1_input); 1633 device_create_file(&new_client->dev, &sensor_dev_attr_temp1_input.dev_attr);
1676 device_create_file(&new_client->dev, &dev_attr_temp1_max); 1634 device_create_file(&new_client->dev, &sensor_dev_attr_temp1_max.dev_attr);
1677 device_create_file(&new_client->dev, &dev_attr_temp1_min); 1635 device_create_file(&new_client->dev, &sensor_dev_attr_temp1_min.dev_attr);
1678 device_create_file(&new_client->dev, &dev_attr_temp2_input); 1636 device_create_file(&new_client->dev, &sensor_dev_attr_temp2_input.dev_attr);
1679 device_create_file(&new_client->dev, &dev_attr_temp2_max); 1637 device_create_file(&new_client->dev, &sensor_dev_attr_temp2_max.dev_attr);
1680 device_create_file(&new_client->dev, &dev_attr_temp2_min); 1638 device_create_file(&new_client->dev, &sensor_dev_attr_temp2_min.dev_attr);
1681 device_create_file(&new_client->dev, &dev_attr_temp3_input); 1639 device_create_file(&new_client->dev, &sensor_dev_attr_temp3_input.dev_attr);
1682 device_create_file(&new_client->dev, &dev_attr_temp3_max); 1640 device_create_file(&new_client->dev, &sensor_dev_attr_temp3_max.dev_attr);
1683 device_create_file(&new_client->dev, &dev_attr_temp3_min); 1641 device_create_file(&new_client->dev, &sensor_dev_attr_temp3_min.dev_attr);
1684 device_create_file(&new_client->dev, &dev_attr_temp1_offset); 1642 device_create_file(&new_client->dev, &sensor_dev_attr_temp1_offset.dev_attr);
1685 device_create_file(&new_client->dev, &dev_attr_temp2_offset); 1643 device_create_file(&new_client->dev, &sensor_dev_attr_temp2_offset.dev_attr);
1686 device_create_file(&new_client->dev, &dev_attr_temp3_offset); 1644 device_create_file(&new_client->dev, &sensor_dev_attr_temp3_offset.dev_attr);
1687 device_create_file(&new_client->dev, 1645 device_create_file(&new_client->dev,
1688 &dev_attr_temp1_auto_point1_temp); 1646 &sensor_dev_attr_temp1_auto_point1_temp.dev_attr);
1689 device_create_file(&new_client->dev, 1647 device_create_file(&new_client->dev,
1690 &dev_attr_temp2_auto_point1_temp); 1648 &sensor_dev_attr_temp2_auto_point1_temp.dev_attr);
1691 device_create_file(&new_client->dev, 1649 device_create_file(&new_client->dev,
1692 &dev_attr_temp3_auto_point1_temp); 1650 &sensor_dev_attr_temp3_auto_point1_temp.dev_attr);
1693 device_create_file(&new_client->dev, 1651 device_create_file(&new_client->dev,
1694 &dev_attr_temp1_auto_point1_temp_hyst); 1652 &sensor_dev_attr_temp1_auto_point1_temp_hyst.dev_attr);
1695 device_create_file(&new_client->dev, 1653 device_create_file(&new_client->dev,
1696 &dev_attr_temp2_auto_point1_temp_hyst); 1654 &sensor_dev_attr_temp2_auto_point1_temp_hyst.dev_attr);
1697 device_create_file(&new_client->dev, 1655 device_create_file(&new_client->dev,
1698 &dev_attr_temp3_auto_point1_temp_hyst); 1656 &sensor_dev_attr_temp3_auto_point1_temp_hyst.dev_attr);
1699 device_create_file(&new_client->dev, 1657 device_create_file(&new_client->dev,
1700 &dev_attr_temp1_auto_point2_temp); 1658 &sensor_dev_attr_temp1_auto_point2_temp.dev_attr);
1701 device_create_file(&new_client->dev, 1659 device_create_file(&new_client->dev,
1702 &dev_attr_temp2_auto_point2_temp); 1660 &sensor_dev_attr_temp2_auto_point2_temp.dev_attr);
1703 device_create_file(&new_client->dev, 1661 device_create_file(&new_client->dev,
1704 &dev_attr_temp3_auto_point2_temp); 1662 &sensor_dev_attr_temp3_auto_point2_temp.dev_attr);
1705 device_create_file(&new_client->dev, &dev_attr_temp1_crit); 1663 device_create_file(&new_client->dev, &sensor_dev_attr_temp1_crit.dev_attr);
1706 device_create_file(&new_client->dev, &dev_attr_temp2_crit); 1664 device_create_file(&new_client->dev, &sensor_dev_attr_temp2_crit.dev_attr);
1707 device_create_file(&new_client->dev, &dev_attr_temp3_crit); 1665 device_create_file(&new_client->dev, &sensor_dev_attr_temp3_crit.dev_attr);
1708 device_create_file(&new_client->dev, &dev_attr_temp1_crit_enable); 1666 device_create_file(&new_client->dev, &dev_attr_temp1_crit_enable);
1709 device_create_file(&new_client->dev, &dev_attr_temp2_crit_enable); 1667 device_create_file(&new_client->dev, &dev_attr_temp2_crit_enable);
1710 device_create_file(&new_client->dev, &dev_attr_temp3_crit_enable); 1668 device_create_file(&new_client->dev, &dev_attr_temp3_crit_enable);
diff --git a/drivers/i2c/chips/adm1031.c b/drivers/i2c/chips/adm1031.c
index d4385a23f79a..2163dba467c4 100644
--- a/drivers/i2c/chips/adm1031.c
+++ b/drivers/i2c/chips/adm1031.c
@@ -292,11 +292,11 @@ set_fan_auto_channel(struct device *dev, const char *buf, size_t count, int nr)
292} 292}
293 293
294#define fan_auto_channel_offset(offset) \ 294#define fan_auto_channel_offset(offset) \
295static ssize_t show_fan_auto_channel_##offset (struct device *dev, char *buf) \ 295static ssize_t show_fan_auto_channel_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
296{ \ 296{ \
297 return show_fan_auto_channel(dev, buf, offset - 1); \ 297 return show_fan_auto_channel(dev, buf, offset - 1); \
298} \ 298} \
299static ssize_t set_fan_auto_channel_##offset (struct device *dev, \ 299static ssize_t set_fan_auto_channel_##offset (struct device *dev, struct device_attribute *attr, \
300 const char *buf, size_t count) \ 300 const char *buf, size_t count) \
301{ \ 301{ \
302 return set_fan_auto_channel(dev, buf, count, offset - 1); \ 302 return set_fan_auto_channel(dev, buf, count, offset - 1); \
@@ -357,24 +357,24 @@ set_auto_temp_max(struct device *dev, const char *buf, size_t count, int nr)
357} 357}
358 358
359#define auto_temp_reg(offset) \ 359#define auto_temp_reg(offset) \
360static ssize_t show_auto_temp_##offset##_off (struct device *dev, char *buf) \ 360static ssize_t show_auto_temp_##offset##_off (struct device *dev, struct device_attribute *attr, char *buf) \
361{ \ 361{ \
362 return show_auto_temp_off(dev, buf, offset - 1); \ 362 return show_auto_temp_off(dev, buf, offset - 1); \
363} \ 363} \
364static ssize_t show_auto_temp_##offset##_min (struct device *dev, char *buf) \ 364static ssize_t show_auto_temp_##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \
365{ \ 365{ \
366 return show_auto_temp_min(dev, buf, offset - 1); \ 366 return show_auto_temp_min(dev, buf, offset - 1); \
367} \ 367} \
368static ssize_t show_auto_temp_##offset##_max (struct device *dev, char *buf) \ 368static ssize_t show_auto_temp_##offset##_max (struct device *dev, struct device_attribute *attr, char *buf) \
369{ \ 369{ \
370 return show_auto_temp_max(dev, buf, offset - 1); \ 370 return show_auto_temp_max(dev, buf, offset - 1); \
371} \ 371} \
372static ssize_t set_auto_temp_##offset##_min (struct device *dev, \ 372static ssize_t set_auto_temp_##offset##_min (struct device *dev, struct device_attribute *attr, \
373 const char *buf, size_t count) \ 373 const char *buf, size_t count) \
374{ \ 374{ \
375 return set_auto_temp_min(dev, buf, count, offset - 1); \ 375 return set_auto_temp_min(dev, buf, count, offset - 1); \
376} \ 376} \
377static ssize_t set_auto_temp_##offset##_max (struct device *dev, \ 377static ssize_t set_auto_temp_##offset##_max (struct device *dev, struct device_attribute *attr, \
378 const char *buf, size_t count) \ 378 const char *buf, size_t count) \
379{ \ 379{ \
380 return set_auto_temp_max(dev, buf, count, offset - 1); \ 380 return set_auto_temp_max(dev, buf, count, offset - 1); \
@@ -421,11 +421,11 @@ set_pwm(struct device *dev, const char *buf, size_t count, int nr)
421} 421}
422 422
423#define pwm_reg(offset) \ 423#define pwm_reg(offset) \
424static ssize_t show_pwm_##offset (struct device *dev, char *buf) \ 424static ssize_t show_pwm_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
425{ \ 425{ \
426 return show_pwm(dev, buf, offset - 1); \ 426 return show_pwm(dev, buf, offset - 1); \
427} \ 427} \
428static ssize_t set_pwm_##offset (struct device *dev, \ 428static ssize_t set_pwm_##offset (struct device *dev, struct device_attribute *attr, \
429 const char *buf, size_t count) \ 429 const char *buf, size_t count) \
430{ \ 430{ \
431 return set_pwm(dev, buf, count, offset - 1); \ 431 return set_pwm(dev, buf, count, offset - 1); \
@@ -557,24 +557,24 @@ set_fan_div(struct device *dev, const char *buf, size_t count, int nr)
557} 557}
558 558
559#define fan_offset(offset) \ 559#define fan_offset(offset) \
560static ssize_t show_fan_##offset (struct device *dev, char *buf) \ 560static ssize_t show_fan_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
561{ \ 561{ \
562 return show_fan(dev, buf, offset - 1); \ 562 return show_fan(dev, buf, offset - 1); \
563} \ 563} \
564static ssize_t show_fan_##offset##_min (struct device *dev, char *buf) \ 564static ssize_t show_fan_##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \
565{ \ 565{ \
566 return show_fan_min(dev, buf, offset - 1); \ 566 return show_fan_min(dev, buf, offset - 1); \
567} \ 567} \
568static ssize_t show_fan_##offset##_div (struct device *dev, char *buf) \ 568static ssize_t show_fan_##offset##_div (struct device *dev, struct device_attribute *attr, char *buf) \
569{ \ 569{ \
570 return show_fan_div(dev, buf, offset - 1); \ 570 return show_fan_div(dev, buf, offset - 1); \
571} \ 571} \
572static ssize_t set_fan_##offset##_min (struct device *dev, \ 572static ssize_t set_fan_##offset##_min (struct device *dev, struct device_attribute *attr, \
573 const char *buf, size_t count) \ 573 const char *buf, size_t count) \
574{ \ 574{ \
575 return set_fan_min(dev, buf, count, offset - 1); \ 575 return set_fan_min(dev, buf, count, offset - 1); \
576} \ 576} \
577static ssize_t set_fan_##offset##_div (struct device *dev, \ 577static ssize_t set_fan_##offset##_div (struct device *dev, struct device_attribute *attr, \
578 const char *buf, size_t count) \ 578 const char *buf, size_t count) \
579{ \ 579{ \
580 return set_fan_div(dev, buf, count, offset - 1); \ 580 return set_fan_div(dev, buf, count, offset - 1); \
@@ -667,33 +667,33 @@ set_temp_crit(struct device *dev, const char *buf, size_t count, int nr)
667} 667}
668 668
669#define temp_reg(offset) \ 669#define temp_reg(offset) \
670static ssize_t show_temp_##offset (struct device *dev, char *buf) \ 670static ssize_t show_temp_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
671{ \ 671{ \
672 return show_temp(dev, buf, offset - 1); \ 672 return show_temp(dev, buf, offset - 1); \
673} \ 673} \
674static ssize_t show_temp_##offset##_min (struct device *dev, char *buf) \ 674static ssize_t show_temp_##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \
675{ \ 675{ \
676 return show_temp_min(dev, buf, offset - 1); \ 676 return show_temp_min(dev, buf, offset - 1); \
677} \ 677} \
678static ssize_t show_temp_##offset##_max (struct device *dev, char *buf) \ 678static ssize_t show_temp_##offset##_max (struct device *dev, struct device_attribute *attr, char *buf) \
679{ \ 679{ \
680 return show_temp_max(dev, buf, offset - 1); \ 680 return show_temp_max(dev, buf, offset - 1); \
681} \ 681} \
682static ssize_t show_temp_##offset##_crit (struct device *dev, char *buf) \ 682static ssize_t show_temp_##offset##_crit (struct device *dev, struct device_attribute *attr, char *buf) \
683{ \ 683{ \
684 return show_temp_crit(dev, buf, offset - 1); \ 684 return show_temp_crit(dev, buf, offset - 1); \
685} \ 685} \
686static ssize_t set_temp_##offset##_min (struct device *dev, \ 686static ssize_t set_temp_##offset##_min (struct device *dev, struct device_attribute *attr, \
687 const char *buf, size_t count) \ 687 const char *buf, size_t count) \
688{ \ 688{ \
689 return set_temp_min(dev, buf, count, offset - 1); \ 689 return set_temp_min(dev, buf, count, offset - 1); \
690} \ 690} \
691static ssize_t set_temp_##offset##_max (struct device *dev, \ 691static ssize_t set_temp_##offset##_max (struct device *dev, struct device_attribute *attr, \
692 const char *buf, size_t count) \ 692 const char *buf, size_t count) \
693{ \ 693{ \
694 return set_temp_max(dev, buf, count, offset - 1); \ 694 return set_temp_max(dev, buf, count, offset - 1); \
695} \ 695} \
696static ssize_t set_temp_##offset##_crit (struct device *dev, \ 696static ssize_t set_temp_##offset##_crit (struct device *dev, struct device_attribute *attr, \
697 const char *buf, size_t count) \ 697 const char *buf, size_t count) \
698{ \ 698{ \
699 return set_temp_crit(dev, buf, count, offset - 1); \ 699 return set_temp_crit(dev, buf, count, offset - 1); \
@@ -712,7 +712,7 @@ temp_reg(2);
712temp_reg(3); 712temp_reg(3);
713 713
714/* Alarms */ 714/* Alarms */
715static ssize_t show_alarms(struct device *dev, char *buf) 715static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf)
716{ 716{
717 struct adm1031_data *data = adm1031_update_device(dev); 717 struct adm1031_data *data = adm1031_update_device(dev);
718 return sprintf(buf, "%d\n", data->alarm); 718 return sprintf(buf, "%d\n", data->alarm);
diff --git a/drivers/i2c/chips/asb100.c b/drivers/i2c/chips/asb100.c
index 7f899002bc54..4a47b4493e34 100644
--- a/drivers/i2c/chips/asb100.c
+++ b/drivers/i2c/chips/asb100.c
@@ -260,28 +260,28 @@ set_in_reg(MAX, max)
260 260
261#define sysfs_in(offset) \ 261#define sysfs_in(offset) \
262static ssize_t \ 262static ssize_t \
263 show_in##offset (struct device *dev, char *buf) \ 263 show_in##offset (struct device *dev, struct device_attribute *attr, char *buf) \
264{ \ 264{ \
265 return show_in(dev, buf, offset); \ 265 return show_in(dev, buf, offset); \
266} \ 266} \
267static DEVICE_ATTR(in##offset##_input, S_IRUGO, \ 267static DEVICE_ATTR(in##offset##_input, S_IRUGO, \
268 show_in##offset, NULL); \ 268 show_in##offset, NULL); \
269static ssize_t \ 269static ssize_t \
270 show_in##offset##_min (struct device *dev, char *buf) \ 270 show_in##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \
271{ \ 271{ \
272 return show_in_min(dev, buf, offset); \ 272 return show_in_min(dev, buf, offset); \
273} \ 273} \
274static ssize_t \ 274static ssize_t \
275 show_in##offset##_max (struct device *dev, char *buf) \ 275 show_in##offset##_max (struct device *dev, struct device_attribute *attr, char *buf) \
276{ \ 276{ \
277 return show_in_max(dev, buf, offset); \ 277 return show_in_max(dev, buf, offset); \
278} \ 278} \
279static ssize_t set_in##offset##_min (struct device *dev, \ 279static ssize_t set_in##offset##_min (struct device *dev, struct device_attribute *attr, \
280 const char *buf, size_t count) \ 280 const char *buf, size_t count) \
281{ \ 281{ \
282 return set_in_min(dev, buf, count, offset); \ 282 return set_in_min(dev, buf, count, offset); \
283} \ 283} \
284static ssize_t set_in##offset##_max (struct device *dev, \ 284static ssize_t set_in##offset##_max (struct device *dev, struct device_attribute *attr, \
285 const char *buf, size_t count) \ 285 const char *buf, size_t count) \
286{ \ 286{ \
287 return set_in_max(dev, buf, count, offset); \ 287 return set_in_max(dev, buf, count, offset); \
@@ -389,24 +389,24 @@ static ssize_t set_fan_div(struct device *dev, const char *buf,
389} 389}
390 390
391#define sysfs_fan(offset) \ 391#define sysfs_fan(offset) \
392static ssize_t show_fan##offset(struct device *dev, char *buf) \ 392static ssize_t show_fan##offset(struct device *dev, struct device_attribute *attr, char *buf) \
393{ \ 393{ \
394 return show_fan(dev, buf, offset - 1); \ 394 return show_fan(dev, buf, offset - 1); \
395} \ 395} \
396static ssize_t show_fan##offset##_min(struct device *dev, char *buf) \ 396static ssize_t show_fan##offset##_min(struct device *dev, struct device_attribute *attr, char *buf) \
397{ \ 397{ \
398 return show_fan_min(dev, buf, offset - 1); \ 398 return show_fan_min(dev, buf, offset - 1); \
399} \ 399} \
400static ssize_t show_fan##offset##_div(struct device *dev, char *buf) \ 400static ssize_t show_fan##offset##_div(struct device *dev, struct device_attribute *attr, char *buf) \
401{ \ 401{ \
402 return show_fan_div(dev, buf, offset - 1); \ 402 return show_fan_div(dev, buf, offset - 1); \
403} \ 403} \
404static ssize_t set_fan##offset##_min(struct device *dev, const char *buf, \ 404static ssize_t set_fan##offset##_min(struct device *dev, struct device_attribute *attr, const char *buf, \
405 size_t count) \ 405 size_t count) \
406{ \ 406{ \
407 return set_fan_min(dev, buf, count, offset - 1); \ 407 return set_fan_min(dev, buf, count, offset - 1); \
408} \ 408} \
409static ssize_t set_fan##offset##_div(struct device *dev, const char *buf, \ 409static ssize_t set_fan##offset##_div(struct device *dev, struct device_attribute *attr, const char *buf, \
410 size_t count) \ 410 size_t count) \
411{ \ 411{ \
412 return set_fan_div(dev, buf, count, offset - 1); \ 412 return set_fan_div(dev, buf, count, offset - 1); \
@@ -482,27 +482,27 @@ set_temp_reg(MAX, temp_max);
482set_temp_reg(HYST, temp_hyst); 482set_temp_reg(HYST, temp_hyst);
483 483
484#define sysfs_temp(num) \ 484#define sysfs_temp(num) \
485static ssize_t show_temp##num(struct device *dev, char *buf) \ 485static ssize_t show_temp##num(struct device *dev, struct device_attribute *attr, char *buf) \
486{ \ 486{ \
487 return show_temp(dev, buf, num-1); \ 487 return show_temp(dev, buf, num-1); \
488} \ 488} \
489static DEVICE_ATTR(temp##num##_input, S_IRUGO, show_temp##num, NULL); \ 489static DEVICE_ATTR(temp##num##_input, S_IRUGO, show_temp##num, NULL); \
490static ssize_t show_temp_max##num(struct device *dev, char *buf) \ 490static ssize_t show_temp_max##num(struct device *dev, struct device_attribute *attr, char *buf) \
491{ \ 491{ \
492 return show_temp_max(dev, buf, num-1); \ 492 return show_temp_max(dev, buf, num-1); \
493} \ 493} \
494static ssize_t set_temp_max##num(struct device *dev, const char *buf, \ 494static ssize_t set_temp_max##num(struct device *dev, struct device_attribute *attr, const char *buf, \
495 size_t count) \ 495 size_t count) \
496{ \ 496{ \
497 return set_temp_max(dev, buf, count, num-1); \ 497 return set_temp_max(dev, buf, count, num-1); \
498} \ 498} \
499static DEVICE_ATTR(temp##num##_max, S_IRUGO | S_IWUSR, \ 499static DEVICE_ATTR(temp##num##_max, S_IRUGO | S_IWUSR, \
500 show_temp_max##num, set_temp_max##num); \ 500 show_temp_max##num, set_temp_max##num); \
501static ssize_t show_temp_hyst##num(struct device *dev, char *buf) \ 501static ssize_t show_temp_hyst##num(struct device *dev, struct device_attribute *attr, char *buf) \
502{ \ 502{ \
503 return show_temp_hyst(dev, buf, num-1); \ 503 return show_temp_hyst(dev, buf, num-1); \
504} \ 504} \
505static ssize_t set_temp_hyst##num(struct device *dev, const char *buf, \ 505static ssize_t set_temp_hyst##num(struct device *dev, struct device_attribute *attr, const char *buf, \
506 size_t count) \ 506 size_t count) \
507{ \ 507{ \
508 return set_temp_hyst(dev, buf, count, num-1); \ 508 return set_temp_hyst(dev, buf, count, num-1); \
@@ -522,7 +522,7 @@ sysfs_temp(4);
522 device_create_file(&client->dev, &dev_attr_temp##num##_max_hyst); \ 522 device_create_file(&client->dev, &dev_attr_temp##num##_max_hyst); \
523} while (0) 523} while (0)
524 524
525static ssize_t show_vid(struct device *dev, char *buf) 525static ssize_t show_vid(struct device *dev, struct device_attribute *attr, char *buf)
526{ 526{
527 struct asb100_data *data = asb100_update_device(dev); 527 struct asb100_data *data = asb100_update_device(dev);
528 return sprintf(buf, "%d\n", vid_from_reg(data->vid, data->vrm)); 528 return sprintf(buf, "%d\n", vid_from_reg(data->vid, data->vrm));
@@ -533,13 +533,13 @@ static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid, NULL);
533device_create_file(&client->dev, &dev_attr_cpu0_vid) 533device_create_file(&client->dev, &dev_attr_cpu0_vid)
534 534
535/* VRM */ 535/* VRM */
536static ssize_t show_vrm(struct device *dev, char *buf) 536static ssize_t show_vrm(struct device *dev, struct device_attribute *attr, char *buf)
537{ 537{
538 struct asb100_data *data = asb100_update_device(dev); 538 struct asb100_data *data = asb100_update_device(dev);
539 return sprintf(buf, "%d\n", data->vrm); 539 return sprintf(buf, "%d\n", data->vrm);
540} 540}
541 541
542static ssize_t set_vrm(struct device *dev, const char *buf, size_t count) 542static ssize_t set_vrm(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
543{ 543{
544 struct i2c_client *client = to_i2c_client(dev); 544 struct i2c_client *client = to_i2c_client(dev);
545 struct asb100_data *data = i2c_get_clientdata(client); 545 struct asb100_data *data = i2c_get_clientdata(client);
@@ -553,7 +553,7 @@ static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm, set_vrm);
553#define device_create_file_vrm(client) \ 553#define device_create_file_vrm(client) \
554device_create_file(&client->dev, &dev_attr_vrm); 554device_create_file(&client->dev, &dev_attr_vrm);
555 555
556static ssize_t show_alarms(struct device *dev, char *buf) 556static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf)
557{ 557{
558 struct asb100_data *data = asb100_update_device(dev); 558 struct asb100_data *data = asb100_update_device(dev);
559 return sprintf(buf, "%d\n", ALARMS_FROM_REG(data->alarms)); 559 return sprintf(buf, "%d\n", ALARMS_FROM_REG(data->alarms));
@@ -564,13 +564,13 @@ static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL);
564device_create_file(&client->dev, &dev_attr_alarms) 564device_create_file(&client->dev, &dev_attr_alarms)
565 565
566/* 1 PWM */ 566/* 1 PWM */
567static ssize_t show_pwm1(struct device *dev, char *buf) 567static ssize_t show_pwm1(struct device *dev, struct device_attribute *attr, char *buf)
568{ 568{
569 struct asb100_data *data = asb100_update_device(dev); 569 struct asb100_data *data = asb100_update_device(dev);
570 return sprintf(buf, "%d\n", ASB100_PWM_FROM_REG(data->pwm & 0x0f)); 570 return sprintf(buf, "%d\n", ASB100_PWM_FROM_REG(data->pwm & 0x0f));
571} 571}
572 572
573static ssize_t set_pwm1(struct device *dev, const char *buf, size_t count) 573static ssize_t set_pwm1(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
574{ 574{
575 struct i2c_client *client = to_i2c_client(dev); 575 struct i2c_client *client = to_i2c_client(dev);
576 struct asb100_data *data = i2c_get_clientdata(client); 576 struct asb100_data *data = i2c_get_clientdata(client);
@@ -584,13 +584,13 @@ static ssize_t set_pwm1(struct device *dev, const char *buf, size_t count)
584 return count; 584 return count;
585} 585}
586 586
587static ssize_t show_pwm_enable1(struct device *dev, char *buf) 587static ssize_t show_pwm_enable1(struct device *dev, struct device_attribute *attr, char *buf)
588{ 588{
589 struct asb100_data *data = asb100_update_device(dev); 589 struct asb100_data *data = asb100_update_device(dev);
590 return sprintf(buf, "%d\n", (data->pwm & 0x80) ? 1 : 0); 590 return sprintf(buf, "%d\n", (data->pwm & 0x80) ? 1 : 0);
591} 591}
592 592
593static ssize_t set_pwm_enable1(struct device *dev, const char *buf, 593static ssize_t set_pwm_enable1(struct device *dev, struct device_attribute *attr, const char *buf,
594 size_t count) 594 size_t count)
595{ 595{
596 struct i2c_client *client = to_i2c_client(dev); 596 struct i2c_client *client = to_i2c_client(dev);
diff --git a/drivers/i2c/chips/ds1621.c b/drivers/i2c/chips/ds1621.c
index bb1fefb2162e..4ae15bd5dcfb 100644
--- a/drivers/i2c/chips/ds1621.c
+++ b/drivers/i2c/chips/ds1621.c
@@ -137,7 +137,7 @@ static void ds1621_init_client(struct i2c_client *client)
137} 137}
138 138
139#define show(value) \ 139#define show(value) \
140static ssize_t show_##value(struct device *dev, char *buf) \ 140static ssize_t show_##value(struct device *dev, struct device_attribute *attr, char *buf) \
141{ \ 141{ \
142 struct ds1621_data *data = ds1621_update_client(dev); \ 142 struct ds1621_data *data = ds1621_update_client(dev); \
143 return sprintf(buf, "%d\n", LM75_TEMP_FROM_REG(data->value)); \ 143 return sprintf(buf, "%d\n", LM75_TEMP_FROM_REG(data->value)); \
@@ -148,7 +148,7 @@ show(temp_min);
148show(temp_max); 148show(temp_max);
149 149
150#define set_temp(suffix, value, reg) \ 150#define set_temp(suffix, value, reg) \
151static ssize_t set_temp_##suffix(struct device *dev, const char *buf, \ 151static ssize_t set_temp_##suffix(struct device *dev, struct device_attribute *attr, const char *buf, \
152 size_t count) \ 152 size_t count) \
153{ \ 153{ \
154 struct i2c_client *client = to_i2c_client(dev); \ 154 struct i2c_client *client = to_i2c_client(dev); \
@@ -165,7 +165,7 @@ static ssize_t set_temp_##suffix(struct device *dev, const char *buf, \
165set_temp(min, temp_min, DS1621_REG_TEMP_MIN); 165set_temp(min, temp_min, DS1621_REG_TEMP_MIN);
166set_temp(max, temp_max, DS1621_REG_TEMP_MAX); 166set_temp(max, temp_max, DS1621_REG_TEMP_MAX);
167 167
168static ssize_t show_alarms(struct device *dev, char *buf) 168static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf)
169{ 169{
170 struct ds1621_data *data = ds1621_update_client(dev); 170 struct ds1621_data *data = ds1621_update_client(dev);
171 return sprintf(buf, "%d\n", ALARMS_FROM_REG(data->conf)); 171 return sprintf(buf, "%d\n", ALARMS_FROM_REG(data->conf));
diff --git a/drivers/i2c/chips/fscher.c b/drivers/i2c/chips/fscher.c
index 18e33ac59d0c..c3f37dbec11a 100644
--- a/drivers/i2c/chips/fscher.c
+++ b/drivers/i2c/chips/fscher.c
@@ -157,8 +157,8 @@ struct fscher_data {
157 157
158#define sysfs_r(kind, sub, offset, reg) \ 158#define sysfs_r(kind, sub, offset, reg) \
159static ssize_t show_##kind##sub (struct fscher_data *, char *, int); \ 159static ssize_t show_##kind##sub (struct fscher_data *, char *, int); \
160static ssize_t show_##kind##offset##sub (struct device *, char *); \ 160static ssize_t show_##kind##offset##sub (struct device *, struct device_attribute *attr, char *); \
161static ssize_t show_##kind##offset##sub (struct device *dev, char *buf) \ 161static ssize_t show_##kind##offset##sub (struct device *dev, struct device_attribute *attr, char *buf) \
162{ \ 162{ \
163 struct fscher_data *data = fscher_update_device(dev); \ 163 struct fscher_data *data = fscher_update_device(dev); \
164 return show_##kind##sub(data, buf, (offset)); \ 164 return show_##kind##sub(data, buf, (offset)); \
@@ -166,8 +166,8 @@ static ssize_t show_##kind##offset##sub (struct device *dev, char *buf) \
166 166
167#define sysfs_w(kind, sub, offset, reg) \ 167#define sysfs_w(kind, sub, offset, reg) \
168static ssize_t set_##kind##sub (struct i2c_client *, struct fscher_data *, const char *, size_t, int, int); \ 168static ssize_t set_##kind##sub (struct i2c_client *, struct fscher_data *, const char *, size_t, int, int); \
169static ssize_t set_##kind##offset##sub (struct device *, const char *, size_t); \ 169static ssize_t set_##kind##offset##sub (struct device *, struct device_attribute *attr, const char *, size_t); \
170static ssize_t set_##kind##offset##sub (struct device *dev, const char *buf, size_t count) \ 170static ssize_t set_##kind##offset##sub (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \
171{ \ 171{ \
172 struct i2c_client *client = to_i2c_client(dev); \ 172 struct i2c_client *client = to_i2c_client(dev); \
173 struct fscher_data *data = i2c_get_clientdata(client); \ 173 struct fscher_data *data = i2c_get_clientdata(client); \
diff --git a/drivers/i2c/chips/fscpos.c b/drivers/i2c/chips/fscpos.c
index 2cac79145c75..3beaa6191ef4 100644
--- a/drivers/i2c/chips/fscpos.c
+++ b/drivers/i2c/chips/fscpos.c
@@ -245,19 +245,19 @@ static void reset_fan_alarm(struct i2c_client *client, int nr)
245/* Volts */ 245/* Volts */
246#define VOLT_FROM_REG(val, mult) ((val) * (mult) / 255) 246#define VOLT_FROM_REG(val, mult) ((val) * (mult) / 255)
247 247
248static ssize_t show_volt_12(struct device *dev, char *buf) 248static ssize_t show_volt_12(struct device *dev, struct device_attribute *attr, char *buf)
249{ 249{
250 struct fscpos_data *data = fscpos_update_device(dev); 250 struct fscpos_data *data = fscpos_update_device(dev);
251 return sprintf(buf, "%u\n", VOLT_FROM_REG(data->volt[0], 14200)); 251 return sprintf(buf, "%u\n", VOLT_FROM_REG(data->volt[0], 14200));
252} 252}
253 253
254static ssize_t show_volt_5(struct device *dev, char *buf) 254static ssize_t show_volt_5(struct device *dev, struct device_attribute *attr, char *buf)
255{ 255{
256 struct fscpos_data *data = fscpos_update_device(dev); 256 struct fscpos_data *data = fscpos_update_device(dev);
257 return sprintf(buf, "%u\n", VOLT_FROM_REG(data->volt[1], 6600)); 257 return sprintf(buf, "%u\n", VOLT_FROM_REG(data->volt[1], 6600));
258} 258}
259 259
260static ssize_t show_volt_batt(struct device *dev, char *buf) 260static ssize_t show_volt_batt(struct device *dev, struct device_attribute *attr, char *buf)
261{ 261{
262 struct fscpos_data *data = fscpos_update_device(dev); 262 struct fscpos_data *data = fscpos_update_device(dev);
263 return sprintf(buf, "%u\n", VOLT_FROM_REG(data->volt[2], 3300)); 263 return sprintf(buf, "%u\n", VOLT_FROM_REG(data->volt[2], 3300));
@@ -327,7 +327,7 @@ static ssize_t set_wdog_preset(struct i2c_client *client, struct fscpos_data
327} 327}
328 328
329/* Event */ 329/* Event */
330static ssize_t show_event(struct device *dev, char *buf) 330static ssize_t show_event(struct device *dev, struct device_attribute *attr, char *buf)
331{ 331{
332 /* bits 5..7 reserved => mask with 0x1f */ 332 /* bits 5..7 reserved => mask with 0x1f */
333 struct fscpos_data *data = fscpos_update_device(dev); 333 struct fscpos_data *data = fscpos_update_device(dev);
@@ -338,14 +338,14 @@ static ssize_t show_event(struct device *dev, char *buf)
338 * Sysfs stuff 338 * Sysfs stuff
339 */ 339 */
340#define create_getter(kind, sub) \ 340#define create_getter(kind, sub) \
341 static ssize_t sysfs_show_##kind##sub(struct device *dev, char *buf) \ 341 static ssize_t sysfs_show_##kind##sub(struct device *dev, struct device_attribute *attr, char *buf) \
342 { \ 342 { \
343 struct fscpos_data *data = fscpos_update_device(dev); \ 343 struct fscpos_data *data = fscpos_update_device(dev); \
344 return show_##kind##sub(data, buf); \ 344 return show_##kind##sub(data, buf); \
345 } 345 }
346 346
347#define create_getter_n(kind, offset, sub) \ 347#define create_getter_n(kind, offset, sub) \
348 static ssize_t sysfs_show_##kind##offset##sub(struct device *dev, char\ 348 static ssize_t sysfs_show_##kind##offset##sub(struct device *dev, struct device_attribute *attr, char\
349 *buf) \ 349 *buf) \
350 { \ 350 { \
351 struct fscpos_data *data = fscpos_update_device(dev); \ 351 struct fscpos_data *data = fscpos_update_device(dev); \
@@ -353,7 +353,7 @@ static ssize_t show_event(struct device *dev, char *buf)
353 } 353 }
354 354
355#define create_setter(kind, sub, reg) \ 355#define create_setter(kind, sub, reg) \
356 static ssize_t sysfs_set_##kind##sub (struct device *dev, const char \ 356 static ssize_t sysfs_set_##kind##sub (struct device *dev, struct device_attribute *attr, const char \
357 *buf, size_t count) \ 357 *buf, size_t count) \
358 { \ 358 { \
359 struct i2c_client *client = to_i2c_client(dev); \ 359 struct i2c_client *client = to_i2c_client(dev); \
@@ -362,7 +362,7 @@ static ssize_t show_event(struct device *dev, char *buf)
362 } 362 }
363 363
364#define create_setter_n(kind, offset, sub, reg) \ 364#define create_setter_n(kind, offset, sub, reg) \
365 static ssize_t sysfs_set_##kind##offset##sub (struct device *dev, \ 365 static ssize_t sysfs_set_##kind##offset##sub (struct device *dev, struct device_attribute *attr, \
366 const char *buf, size_t count) \ 366 const char *buf, size_t count) \
367 { \ 367 { \
368 struct i2c_client *client = to_i2c_client(dev); \ 368 struct i2c_client *client = to_i2c_client(dev); \
diff --git a/drivers/i2c/chips/gl518sm.c b/drivers/i2c/chips/gl518sm.c
index c82d6ce21205..4316a1562251 100644
--- a/drivers/i2c/chips/gl518sm.c
+++ b/drivers/i2c/chips/gl518sm.c
@@ -164,14 +164,14 @@ static struct i2c_driver gl518_driver = {
164 */ 164 */
165 165
166#define show(type, suffix, value) \ 166#define show(type, suffix, value) \
167static ssize_t show_##suffix(struct device *dev, char *buf) \ 167static ssize_t show_##suffix(struct device *dev, struct device_attribute *attr, char *buf) \
168{ \ 168{ \
169 struct gl518_data *data = gl518_update_device(dev); \ 169 struct gl518_data *data = gl518_update_device(dev); \
170 return sprintf(buf, "%d\n", type##_FROM_REG(data->value)); \ 170 return sprintf(buf, "%d\n", type##_FROM_REG(data->value)); \
171} 171}
172 172
173#define show_fan(suffix, value, index) \ 173#define show_fan(suffix, value, index) \
174static ssize_t show_##suffix(struct device *dev, char *buf) \ 174static ssize_t show_##suffix(struct device *dev, struct device_attribute *attr, char *buf) \
175{ \ 175{ \
176 struct gl518_data *data = gl518_update_device(dev); \ 176 struct gl518_data *data = gl518_update_device(dev); \
177 return sprintf(buf, "%d\n", FAN_FROM_REG(data->value[index], \ 177 return sprintf(buf, "%d\n", FAN_FROM_REG(data->value[index], \
@@ -205,7 +205,7 @@ show(BOOL, beep_enable, beep_enable);
205show(BEEP_MASK, beep_mask, beep_mask); 205show(BEEP_MASK, beep_mask, beep_mask);
206 206
207#define set(type, suffix, value, reg) \ 207#define set(type, suffix, value, reg) \
208static ssize_t set_##suffix(struct device *dev, const char *buf, \ 208static ssize_t set_##suffix(struct device *dev, struct device_attribute *attr, const char *buf, \
209 size_t count) \ 209 size_t count) \
210{ \ 210{ \
211 struct i2c_client *client = to_i2c_client(dev); \ 211 struct i2c_client *client = to_i2c_client(dev); \
@@ -220,7 +220,7 @@ static ssize_t set_##suffix(struct device *dev, const char *buf, \
220} 220}
221 221
222#define set_bits(type, suffix, value, reg, mask, shift) \ 222#define set_bits(type, suffix, value, reg, mask, shift) \
223static ssize_t set_##suffix(struct device *dev, const char *buf, \ 223static ssize_t set_##suffix(struct device *dev, struct device_attribute *attr, const char *buf, \
224 size_t count) \ 224 size_t count) \
225{ \ 225{ \
226 struct i2c_client *client = to_i2c_client(dev); \ 226 struct i2c_client *client = to_i2c_client(dev); \
@@ -258,7 +258,7 @@ set_high(IN, in_max3, voltage_max[3], GL518_REG_VIN3_LIMIT);
258set_bits(BOOL, beep_enable, beep_enable, GL518_REG_CONF, 0x04, 2); 258set_bits(BOOL, beep_enable, beep_enable, GL518_REG_CONF, 0x04, 2);
259set(BEEP_MASK, beep_mask, beep_mask, GL518_REG_ALARM); 259set(BEEP_MASK, beep_mask, beep_mask, GL518_REG_ALARM);
260 260
261static ssize_t set_fan_min1(struct device *dev, const char *buf, size_t count) 261static ssize_t set_fan_min1(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
262{ 262{
263 struct i2c_client *client = to_i2c_client(dev); 263 struct i2c_client *client = to_i2c_client(dev);
264 struct gl518_data *data = i2c_get_clientdata(client); 264 struct gl518_data *data = i2c_get_clientdata(client);
@@ -284,7 +284,7 @@ static ssize_t set_fan_min1(struct device *dev, const char *buf, size_t count)
284 return count; 284 return count;
285} 285}
286 286
287static ssize_t set_fan_min2(struct device *dev, const char *buf, size_t count) 287static ssize_t set_fan_min2(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
288{ 288{
289 struct i2c_client *client = to_i2c_client(dev); 289 struct i2c_client *client = to_i2c_client(dev);
290 struct gl518_data *data = i2c_get_clientdata(client); 290 struct gl518_data *data = i2c_get_clientdata(client);
diff --git a/drivers/i2c/chips/gl520sm.c b/drivers/i2c/chips/gl520sm.c
index 3fd17e46ffc6..a13a504f5bfa 100644
--- a/drivers/i2c/chips/gl520sm.c
+++ b/drivers/i2c/chips/gl520sm.c
@@ -148,8 +148,8 @@ struct gl520_data {
148 148
149#define sysfs_r(type, n, item, reg) \ 149#define sysfs_r(type, n, item, reg) \
150static ssize_t get_##type##item (struct gl520_data *, char *, int); \ 150static ssize_t get_##type##item (struct gl520_data *, char *, int); \
151static ssize_t get_##type##n##item (struct device *, char *); \ 151static ssize_t get_##type##n##item (struct device *, struct device_attribute *attr, char *); \
152static ssize_t get_##type##n##item (struct device *dev, char *buf) \ 152static ssize_t get_##type##n##item (struct device *dev, struct device_attribute *attr, char *buf) \
153{ \ 153{ \
154 struct gl520_data *data = gl520_update_device(dev); \ 154 struct gl520_data *data = gl520_update_device(dev); \
155 return get_##type##item(data, buf, (n)); \ 155 return get_##type##item(data, buf, (n)); \
@@ -157,8 +157,8 @@ static ssize_t get_##type##n##item (struct device *dev, char *buf) \
157 157
158#define sysfs_w(type, n, item, reg) \ 158#define sysfs_w(type, n, item, reg) \
159static ssize_t set_##type##item (struct i2c_client *, struct gl520_data *, const char *, size_t, int, int); \ 159static ssize_t set_##type##item (struct i2c_client *, struct gl520_data *, const char *, size_t, int, int); \
160static ssize_t set_##type##n##item (struct device *, const char *, size_t); \ 160static ssize_t set_##type##n##item (struct device *, struct device_attribute *attr, const char *, size_t); \
161static ssize_t set_##type##n##item (struct device *dev, const char *buf, size_t count) \ 161static ssize_t set_##type##n##item (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \
162{ \ 162{ \
163 struct i2c_client *client = to_i2c_client(dev); \ 163 struct i2c_client *client = to_i2c_client(dev); \
164 struct gl520_data *data = i2c_get_clientdata(client); \ 164 struct gl520_data *data = i2c_get_clientdata(client); \
diff --git a/drivers/i2c/chips/it87.c b/drivers/i2c/chips/it87.c
index cf7e6898754f..007bdf9e7e2a 100644
--- a/drivers/i2c/chips/it87.c
+++ b/drivers/i2c/chips/it87.c
@@ -290,7 +290,7 @@ static ssize_t set_in_max(struct device *dev, const char *buf,
290 290
291#define show_in_offset(offset) \ 291#define show_in_offset(offset) \
292static ssize_t \ 292static ssize_t \
293 show_in##offset (struct device *dev, char *buf) \ 293 show_in##offset (struct device *dev, struct device_attribute *attr, char *buf) \
294{ \ 294{ \
295 return show_in(dev, buf, offset); \ 295 return show_in(dev, buf, offset); \
296} \ 296} \
@@ -298,21 +298,21 @@ static DEVICE_ATTR(in##offset##_input, S_IRUGO, show_in##offset, NULL);
298 298
299#define limit_in_offset(offset) \ 299#define limit_in_offset(offset) \
300static ssize_t \ 300static ssize_t \
301 show_in##offset##_min (struct device *dev, char *buf) \ 301 show_in##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \
302{ \ 302{ \
303 return show_in_min(dev, buf, offset); \ 303 return show_in_min(dev, buf, offset); \
304} \ 304} \
305static ssize_t \ 305static ssize_t \
306 show_in##offset##_max (struct device *dev, char *buf) \ 306 show_in##offset##_max (struct device *dev, struct device_attribute *attr, char *buf) \
307{ \ 307{ \
308 return show_in_max(dev, buf, offset); \ 308 return show_in_max(dev, buf, offset); \
309} \ 309} \
310static ssize_t set_in##offset##_min (struct device *dev, \ 310static ssize_t set_in##offset##_min (struct device *dev, struct device_attribute *attr, \
311 const char *buf, size_t count) \ 311 const char *buf, size_t count) \
312{ \ 312{ \
313 return set_in_min(dev, buf, count, offset); \ 313 return set_in_min(dev, buf, count, offset); \
314} \ 314} \
315static ssize_t set_in##offset##_max (struct device *dev, \ 315static ssize_t set_in##offset##_max (struct device *dev, struct device_attribute *attr, \
316 const char *buf, size_t count) \ 316 const char *buf, size_t count) \
317{ \ 317{ \
318 return set_in_max(dev, buf, count, offset); \ 318 return set_in_max(dev, buf, count, offset); \
@@ -383,26 +383,26 @@ static ssize_t set_temp_min(struct device *dev, const char *buf,
383 return count; 383 return count;
384} 384}
385#define show_temp_offset(offset) \ 385#define show_temp_offset(offset) \
386static ssize_t show_temp_##offset (struct device *dev, char *buf) \ 386static ssize_t show_temp_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
387{ \ 387{ \
388 return show_temp(dev, buf, offset - 1); \ 388 return show_temp(dev, buf, offset - 1); \
389} \ 389} \
390static ssize_t \ 390static ssize_t \
391show_temp_##offset##_max (struct device *dev, char *buf) \ 391show_temp_##offset##_max (struct device *dev, struct device_attribute *attr, char *buf) \
392{ \ 392{ \
393 return show_temp_max(dev, buf, offset - 1); \ 393 return show_temp_max(dev, buf, offset - 1); \
394} \ 394} \
395static ssize_t \ 395static ssize_t \
396show_temp_##offset##_min (struct device *dev, char *buf) \ 396show_temp_##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \
397{ \ 397{ \
398 return show_temp_min(dev, buf, offset - 1); \ 398 return show_temp_min(dev, buf, offset - 1); \
399} \ 399} \
400static ssize_t set_temp_##offset##_max (struct device *dev, \ 400static ssize_t set_temp_##offset##_max (struct device *dev, struct device_attribute *attr, \
401 const char *buf, size_t count) \ 401 const char *buf, size_t count) \
402{ \ 402{ \
403 return set_temp_max(dev, buf, count, offset - 1); \ 403 return set_temp_max(dev, buf, count, offset - 1); \
404} \ 404} \
405static ssize_t set_temp_##offset##_min (struct device *dev, \ 405static ssize_t set_temp_##offset##_min (struct device *dev, struct device_attribute *attr, \
406 const char *buf, size_t count) \ 406 const char *buf, size_t count) \
407{ \ 407{ \
408 return set_temp_min(dev, buf, count, offset - 1); \ 408 return set_temp_min(dev, buf, count, offset - 1); \
@@ -453,11 +453,11 @@ static ssize_t set_sensor(struct device *dev, const char *buf,
453 return count; 453 return count;
454} 454}
455#define show_sensor_offset(offset) \ 455#define show_sensor_offset(offset) \
456static ssize_t show_sensor_##offset (struct device *dev, char *buf) \ 456static ssize_t show_sensor_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
457{ \ 457{ \
458 return show_sensor(dev, buf, offset - 1); \ 458 return show_sensor(dev, buf, offset - 1); \
459} \ 459} \
460static ssize_t set_sensor_##offset (struct device *dev, \ 460static ssize_t set_sensor_##offset (struct device *dev, struct device_attribute *attr, \
461 const char *buf, size_t count) \ 461 const char *buf, size_t count) \
462{ \ 462{ \
463 return set_sensor(dev, buf, count, offset - 1); \ 463 return set_sensor(dev, buf, count, offset - 1); \
@@ -600,24 +600,24 @@ static ssize_t set_pwm(struct device *dev, const char *buf,
600} 600}
601 601
602#define show_fan_offset(offset) \ 602#define show_fan_offset(offset) \
603static ssize_t show_fan_##offset (struct device *dev, char *buf) \ 603static ssize_t show_fan_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
604{ \ 604{ \
605 return show_fan(dev, buf, offset - 1); \ 605 return show_fan(dev, buf, offset - 1); \
606} \ 606} \
607static ssize_t show_fan_##offset##_min (struct device *dev, char *buf) \ 607static ssize_t show_fan_##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \
608{ \ 608{ \
609 return show_fan_min(dev, buf, offset - 1); \ 609 return show_fan_min(dev, buf, offset - 1); \
610} \ 610} \
611static ssize_t show_fan_##offset##_div (struct device *dev, char *buf) \ 611static ssize_t show_fan_##offset##_div (struct device *dev, struct device_attribute *attr, char *buf) \
612{ \ 612{ \
613 return show_fan_div(dev, buf, offset - 1); \ 613 return show_fan_div(dev, buf, offset - 1); \
614} \ 614} \
615static ssize_t set_fan_##offset##_min (struct device *dev, \ 615static ssize_t set_fan_##offset##_min (struct device *dev, struct device_attribute *attr, \
616 const char *buf, size_t count) \ 616 const char *buf, size_t count) \
617{ \ 617{ \
618 return set_fan_min(dev, buf, count, offset - 1); \ 618 return set_fan_min(dev, buf, count, offset - 1); \
619} \ 619} \
620static ssize_t set_fan_##offset##_div (struct device *dev, \ 620static ssize_t set_fan_##offset##_div (struct device *dev, struct device_attribute *attr, \
621 const char *buf, size_t count) \ 621 const char *buf, size_t count) \
622{ \ 622{ \
623 return set_fan_div(dev, buf, count, offset - 1); \ 623 return set_fan_div(dev, buf, count, offset - 1); \
@@ -633,21 +633,21 @@ show_fan_offset(2);
633show_fan_offset(3); 633show_fan_offset(3);
634 634
635#define show_pwm_offset(offset) \ 635#define show_pwm_offset(offset) \
636static ssize_t show_pwm##offset##_enable (struct device *dev, \ 636static ssize_t show_pwm##offset##_enable (struct device *dev, struct device_attribute *attr, \
637 char *buf) \ 637 char *buf) \
638{ \ 638{ \
639 return show_pwm_enable(dev, buf, offset - 1); \ 639 return show_pwm_enable(dev, buf, offset - 1); \
640} \ 640} \
641static ssize_t show_pwm##offset (struct device *dev, char *buf) \ 641static ssize_t show_pwm##offset (struct device *dev, struct device_attribute *attr, char *buf) \
642{ \ 642{ \
643 return show_pwm(dev, buf, offset - 1); \ 643 return show_pwm(dev, buf, offset - 1); \
644} \ 644} \
645static ssize_t set_pwm##offset##_enable (struct device *dev, \ 645static ssize_t set_pwm##offset##_enable (struct device *dev, struct device_attribute *attr, \
646 const char *buf, size_t count) \ 646 const char *buf, size_t count) \
647{ \ 647{ \
648 return set_pwm_enable(dev, buf, count, offset - 1); \ 648 return set_pwm_enable(dev, buf, count, offset - 1); \
649} \ 649} \
650static ssize_t set_pwm##offset (struct device *dev, \ 650static ssize_t set_pwm##offset (struct device *dev, struct device_attribute *attr, \
651 const char *buf, size_t count) \ 651 const char *buf, size_t count) \
652{ \ 652{ \
653 return set_pwm(dev, buf, count, offset - 1); \ 653 return set_pwm(dev, buf, count, offset - 1); \
@@ -663,7 +663,7 @@ show_pwm_offset(2);
663show_pwm_offset(3); 663show_pwm_offset(3);
664 664
665/* Alarms */ 665/* Alarms */
666static ssize_t show_alarms(struct device *dev, char *buf) 666static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf)
667{ 667{
668 struct it87_data *data = it87_update_device(dev); 668 struct it87_data *data = it87_update_device(dev);
669 return sprintf(buf,"%d\n", ALARMS_FROM_REG(data->alarms)); 669 return sprintf(buf,"%d\n", ALARMS_FROM_REG(data->alarms));
@@ -671,13 +671,13 @@ static ssize_t show_alarms(struct device *dev, char *buf)
671static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL); 671static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL);
672 672
673static ssize_t 673static ssize_t
674show_vrm_reg(struct device *dev, char *buf) 674show_vrm_reg(struct device *dev, struct device_attribute *attr, char *buf)
675{ 675{
676 struct it87_data *data = it87_update_device(dev); 676 struct it87_data *data = it87_update_device(dev);
677 return sprintf(buf, "%ld\n", (long) data->vrm); 677 return sprintf(buf, "%ld\n", (long) data->vrm);
678} 678}
679static ssize_t 679static ssize_t
680store_vrm_reg(struct device *dev, const char *buf, size_t count) 680store_vrm_reg(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
681{ 681{
682 struct i2c_client *client = to_i2c_client(dev); 682 struct i2c_client *client = to_i2c_client(dev);
683 struct it87_data *data = i2c_get_clientdata(client); 683 struct it87_data *data = i2c_get_clientdata(client);
@@ -693,7 +693,7 @@ static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm_reg, store_vrm_reg);
693device_create_file(&client->dev, &dev_attr_vrm) 693device_create_file(&client->dev, &dev_attr_vrm)
694 694
695static ssize_t 695static ssize_t
696show_vid_reg(struct device *dev, char *buf) 696show_vid_reg(struct device *dev, struct device_attribute *attr, char *buf)
697{ 697{
698 struct it87_data *data = it87_update_device(dev); 698 struct it87_data *data = it87_update_device(dev);
699 return sprintf(buf, "%ld\n", (long) vid_from_reg(data->vid, data->vrm)); 699 return sprintf(buf, "%ld\n", (long) vid_from_reg(data->vid, data->vrm));
diff --git a/drivers/i2c/chips/lm63.c b/drivers/i2c/chips/lm63.c
index 14cc5af03739..bc68e031392b 100644
--- a/drivers/i2c/chips/lm63.c
+++ b/drivers/i2c/chips/lm63.c
@@ -177,7 +177,7 @@ struct lm63_data {
177 */ 177 */
178 178
179#define show_fan(value) \ 179#define show_fan(value) \
180static ssize_t show_##value(struct device *dev, char *buf) \ 180static ssize_t show_##value(struct device *dev, struct device_attribute *attr, char *buf) \
181{ \ 181{ \
182 struct lm63_data *data = lm63_update_device(dev); \ 182 struct lm63_data *data = lm63_update_device(dev); \
183 return sprintf(buf, "%d\n", FAN_FROM_REG(data->value)); \ 183 return sprintf(buf, "%d\n", FAN_FROM_REG(data->value)); \
@@ -185,7 +185,7 @@ static ssize_t show_##value(struct device *dev, char *buf) \
185show_fan(fan1_input); 185show_fan(fan1_input);
186show_fan(fan1_low); 186show_fan(fan1_low);
187 187
188static ssize_t set_fan1_low(struct device *dev, const char *buf, 188static ssize_t set_fan1_low(struct device *dev, struct device_attribute *attr, const char *buf,
189 size_t count) 189 size_t count)
190{ 190{
191 struct i2c_client *client = to_i2c_client(dev); 191 struct i2c_client *client = to_i2c_client(dev);
@@ -202,7 +202,7 @@ static ssize_t set_fan1_low(struct device *dev, const char *buf,
202 return count; 202 return count;
203} 203}
204 204
205static ssize_t show_pwm1(struct device *dev, char *buf) 205static ssize_t show_pwm1(struct device *dev, struct device_attribute *attr, char *buf)
206{ 206{
207 struct lm63_data *data = lm63_update_device(dev); 207 struct lm63_data *data = lm63_update_device(dev);
208 return sprintf(buf, "%d\n", data->pwm1_value >= 2 * data->pwm1_freq ? 208 return sprintf(buf, "%d\n", data->pwm1_value >= 2 * data->pwm1_freq ?
@@ -210,7 +210,7 @@ static ssize_t show_pwm1(struct device *dev, char *buf)
210 (2 * data->pwm1_freq)); 210 (2 * data->pwm1_freq));
211} 211}
212 212
213static ssize_t set_pwm1(struct device *dev, const char *buf, size_t count) 213static ssize_t set_pwm1(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
214{ 214{
215 struct i2c_client *client = to_i2c_client(dev); 215 struct i2c_client *client = to_i2c_client(dev);
216 struct lm63_data *data = i2c_get_clientdata(client); 216 struct lm63_data *data = i2c_get_clientdata(client);
@@ -229,20 +229,20 @@ static ssize_t set_pwm1(struct device *dev, const char *buf, size_t count)
229 return count; 229 return count;
230} 230}
231 231
232static ssize_t show_pwm1_enable(struct device *dev, char *buf) 232static ssize_t show_pwm1_enable(struct device *dev, struct device_attribute *attr, char *buf)
233{ 233{
234 struct lm63_data *data = lm63_update_device(dev); 234 struct lm63_data *data = lm63_update_device(dev);
235 return sprintf(buf, "%d\n", data->config_fan & 0x20 ? 1 : 2); 235 return sprintf(buf, "%d\n", data->config_fan & 0x20 ? 1 : 2);
236} 236}
237 237
238#define show_temp8(value) \ 238#define show_temp8(value) \
239static ssize_t show_##value(struct device *dev, char *buf) \ 239static ssize_t show_##value(struct device *dev, struct device_attribute *attr, char *buf) \
240{ \ 240{ \
241 struct lm63_data *data = lm63_update_device(dev); \ 241 struct lm63_data *data = lm63_update_device(dev); \
242 return sprintf(buf, "%d\n", TEMP8_FROM_REG(data->value)); \ 242 return sprintf(buf, "%d\n", TEMP8_FROM_REG(data->value)); \
243} 243}
244#define show_temp11(value) \ 244#define show_temp11(value) \
245static ssize_t show_##value(struct device *dev, char *buf) \ 245static ssize_t show_##value(struct device *dev, struct device_attribute *attr, char *buf) \
246{ \ 246{ \
247 struct lm63_data *data = lm63_update_device(dev); \ 247 struct lm63_data *data = lm63_update_device(dev); \
248 return sprintf(buf, "%d\n", TEMP11_FROM_REG(data->value)); \ 248 return sprintf(buf, "%d\n", TEMP11_FROM_REG(data->value)); \
@@ -255,7 +255,7 @@ show_temp11(temp2_low);
255show_temp8(temp2_crit); 255show_temp8(temp2_crit);
256 256
257#define set_temp8(value, reg) \ 257#define set_temp8(value, reg) \
258static ssize_t set_##value(struct device *dev, const char *buf, \ 258static ssize_t set_##value(struct device *dev, struct device_attribute *attr, const char *buf, \
259 size_t count) \ 259 size_t count) \
260{ \ 260{ \
261 struct i2c_client *client = to_i2c_client(dev); \ 261 struct i2c_client *client = to_i2c_client(dev); \
@@ -269,7 +269,7 @@ static ssize_t set_##value(struct device *dev, const char *buf, \
269 return count; \ 269 return count; \
270} 270}
271#define set_temp11(value, reg_msb, reg_lsb) \ 271#define set_temp11(value, reg_msb, reg_lsb) \
272static ssize_t set_##value(struct device *dev, const char *buf, \ 272static ssize_t set_##value(struct device *dev, struct device_attribute *attr, const char *buf, \
273 size_t count) \ 273 size_t count) \
274{ \ 274{ \
275 struct i2c_client *client = to_i2c_client(dev); \ 275 struct i2c_client *client = to_i2c_client(dev); \
@@ -289,7 +289,7 @@ set_temp11(temp2_low, LM63_REG_REMOTE_LOW_MSB, LM63_REG_REMOTE_LOW_LSB);
289 289
290/* Hysteresis register holds a relative value, while we want to present 290/* Hysteresis register holds a relative value, while we want to present
291 an absolute to user-space */ 291 an absolute to user-space */
292static ssize_t show_temp2_crit_hyst(struct device *dev, char *buf) 292static ssize_t show_temp2_crit_hyst(struct device *dev, struct device_attribute *attr, char *buf)
293{ 293{
294 struct lm63_data *data = lm63_update_device(dev); 294 struct lm63_data *data = lm63_update_device(dev);
295 return sprintf(buf, "%d\n", TEMP8_FROM_REG(data->temp2_crit) 295 return sprintf(buf, "%d\n", TEMP8_FROM_REG(data->temp2_crit)
@@ -298,7 +298,7 @@ static ssize_t show_temp2_crit_hyst(struct device *dev, char *buf)
298 298
299/* And now the other way around, user-space provides an absolute 299/* And now the other way around, user-space provides an absolute
300 hysteresis value and we have to store a relative one */ 300 hysteresis value and we have to store a relative one */
301static ssize_t set_temp2_crit_hyst(struct device *dev, const char *buf, 301static ssize_t set_temp2_crit_hyst(struct device *dev, struct device_attribute *attr, const char *buf,
302 size_t count) 302 size_t count)
303{ 303{
304 struct i2c_client *client = to_i2c_client(dev); 304 struct i2c_client *client = to_i2c_client(dev);
@@ -314,7 +314,7 @@ static ssize_t set_temp2_crit_hyst(struct device *dev, const char *buf,
314 return count; 314 return count;
315} 315}
316 316
317static ssize_t show_alarms(struct device *dev, char *buf) 317static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf)
318{ 318{
319 struct lm63_data *data = lm63_update_device(dev); 319 struct lm63_data *data = lm63_update_device(dev);
320 return sprintf(buf, "%u\n", data->alarms); 320 return sprintf(buf, "%u\n", data->alarms);
diff --git a/drivers/i2c/chips/lm75.c b/drivers/i2c/chips/lm75.c
index 0e86cc893981..57c51ac37c04 100644
--- a/drivers/i2c/chips/lm75.c
+++ b/drivers/i2c/chips/lm75.c
@@ -75,7 +75,7 @@ static struct i2c_driver lm75_driver = {
75}; 75};
76 76
77#define show(value) \ 77#define show(value) \
78static ssize_t show_##value(struct device *dev, char *buf) \ 78static ssize_t show_##value(struct device *dev, struct device_attribute *attr, char *buf) \
79{ \ 79{ \
80 struct lm75_data *data = lm75_update_device(dev); \ 80 struct lm75_data *data = lm75_update_device(dev); \
81 return sprintf(buf, "%d\n", LM75_TEMP_FROM_REG(data->value)); \ 81 return sprintf(buf, "%d\n", LM75_TEMP_FROM_REG(data->value)); \
@@ -85,7 +85,7 @@ show(temp_hyst);
85show(temp_input); 85show(temp_input);
86 86
87#define set(value, reg) \ 87#define set(value, reg) \
88static ssize_t set_##value(struct device *dev, const char *buf, size_t count) \ 88static ssize_t set_##value(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \
89{ \ 89{ \
90 struct i2c_client *client = to_i2c_client(dev); \ 90 struct i2c_client *client = to_i2c_client(dev); \
91 struct lm75_data *data = i2c_get_clientdata(client); \ 91 struct lm75_data *data = i2c_get_clientdata(client); \
diff --git a/drivers/i2c/chips/lm77.c b/drivers/i2c/chips/lm77.c
index f56b7a37de75..9d15cd5189f6 100644
--- a/drivers/i2c/chips/lm77.c
+++ b/drivers/i2c/chips/lm77.c
@@ -103,7 +103,7 @@ static inline int LM77_TEMP_FROM_REG(u16 reg)
103 103
104/* read routines for temperature limits */ 104/* read routines for temperature limits */
105#define show(value) \ 105#define show(value) \
106static ssize_t show_##value(struct device *dev, char *buf) \ 106static ssize_t show_##value(struct device *dev, struct device_attribute *attr, char *buf) \
107{ \ 107{ \
108 struct lm77_data *data = lm77_update_device(dev); \ 108 struct lm77_data *data = lm77_update_device(dev); \
109 return sprintf(buf, "%d\n", data->value); \ 109 return sprintf(buf, "%d\n", data->value); \
@@ -116,17 +116,17 @@ show(temp_max);
116show(alarms); 116show(alarms);
117 117
118/* read routines for hysteresis values */ 118/* read routines for hysteresis values */
119static ssize_t show_temp_crit_hyst(struct device *dev, char *buf) 119static ssize_t show_temp_crit_hyst(struct device *dev, struct device_attribute *attr, char *buf)
120{ 120{
121 struct lm77_data *data = lm77_update_device(dev); 121 struct lm77_data *data = lm77_update_device(dev);
122 return sprintf(buf, "%d\n", data->temp_crit - data->temp_hyst); 122 return sprintf(buf, "%d\n", data->temp_crit - data->temp_hyst);
123} 123}
124static ssize_t show_temp_min_hyst(struct device *dev, char *buf) 124static ssize_t show_temp_min_hyst(struct device *dev, struct device_attribute *attr, char *buf)
125{ 125{
126 struct lm77_data *data = lm77_update_device(dev); 126 struct lm77_data *data = lm77_update_device(dev);
127 return sprintf(buf, "%d\n", data->temp_min + data->temp_hyst); 127 return sprintf(buf, "%d\n", data->temp_min + data->temp_hyst);
128} 128}
129static ssize_t show_temp_max_hyst(struct device *dev, char *buf) 129static ssize_t show_temp_max_hyst(struct device *dev, struct device_attribute *attr, char *buf)
130{ 130{
131 struct lm77_data *data = lm77_update_device(dev); 131 struct lm77_data *data = lm77_update_device(dev);
132 return sprintf(buf, "%d\n", data->temp_max - data->temp_hyst); 132 return sprintf(buf, "%d\n", data->temp_max - data->temp_hyst);
@@ -134,7 +134,7 @@ static ssize_t show_temp_max_hyst(struct device *dev, char *buf)
134 134
135/* write routines */ 135/* write routines */
136#define set(value, reg) \ 136#define set(value, reg) \
137static ssize_t set_##value(struct device *dev, const char *buf, size_t count) \ 137static ssize_t set_##value(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \
138{ \ 138{ \
139 struct i2c_client *client = to_i2c_client(dev); \ 139 struct i2c_client *client = to_i2c_client(dev); \
140 struct lm77_data *data = i2c_get_clientdata(client); \ 140 struct lm77_data *data = i2c_get_clientdata(client); \
@@ -152,7 +152,7 @@ set(temp_max, LM77_REG_TEMP_MAX);
152 152
153/* hysteresis is stored as a relative value on the chip, so it has to be 153/* hysteresis is stored as a relative value on the chip, so it has to be
154 converted first */ 154 converted first */
155static ssize_t set_temp_crit_hyst(struct device *dev, const char *buf, size_t count) 155static ssize_t set_temp_crit_hyst(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
156{ 156{
157 struct i2c_client *client = to_i2c_client(dev); 157 struct i2c_client *client = to_i2c_client(dev);
158 struct lm77_data *data = i2c_get_clientdata(client); 158 struct lm77_data *data = i2c_get_clientdata(client);
@@ -167,7 +167,7 @@ static ssize_t set_temp_crit_hyst(struct device *dev, const char *buf, size_t co
167} 167}
168 168
169/* preserve hysteresis when setting T_crit */ 169/* preserve hysteresis when setting T_crit */
170static ssize_t set_temp_crit(struct device *dev, const char *buf, size_t count) 170static ssize_t set_temp_crit(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
171{ 171{
172 struct i2c_client *client = to_i2c_client(dev); 172 struct i2c_client *client = to_i2c_client(dev);
173 struct lm77_data *data = i2c_get_clientdata(client); 173 struct lm77_data *data = i2c_get_clientdata(client);
diff --git a/drivers/i2c/chips/lm78.c b/drivers/i2c/chips/lm78.c
index 6d52d14eb31c..21b195ff3871 100644
--- a/drivers/i2c/chips/lm78.c
+++ b/drivers/i2c/chips/lm78.c
@@ -224,28 +224,28 @@ static ssize_t set_in_max(struct device *dev, const char *buf,
224 224
225#define show_in_offset(offset) \ 225#define show_in_offset(offset) \
226static ssize_t \ 226static ssize_t \
227 show_in##offset (struct device *dev, char *buf) \ 227 show_in##offset (struct device *dev, struct device_attribute *attr, char *buf) \
228{ \ 228{ \
229 return show_in(dev, buf, offset); \ 229 return show_in(dev, buf, offset); \
230} \ 230} \
231static DEVICE_ATTR(in##offset##_input, S_IRUGO, \ 231static DEVICE_ATTR(in##offset##_input, S_IRUGO, \
232 show_in##offset, NULL); \ 232 show_in##offset, NULL); \
233static ssize_t \ 233static ssize_t \
234 show_in##offset##_min (struct device *dev, char *buf) \ 234 show_in##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \
235{ \ 235{ \
236 return show_in_min(dev, buf, offset); \ 236 return show_in_min(dev, buf, offset); \
237} \ 237} \
238static ssize_t \ 238static ssize_t \
239 show_in##offset##_max (struct device *dev, char *buf) \ 239 show_in##offset##_max (struct device *dev, struct device_attribute *attr, char *buf) \
240{ \ 240{ \
241 return show_in_max(dev, buf, offset); \ 241 return show_in_max(dev, buf, offset); \
242} \ 242} \
243static ssize_t set_in##offset##_min (struct device *dev, \ 243static ssize_t set_in##offset##_min (struct device *dev, struct device_attribute *attr, \
244 const char *buf, size_t count) \ 244 const char *buf, size_t count) \
245{ \ 245{ \
246 return set_in_min(dev, buf, count, offset); \ 246 return set_in_min(dev, buf, count, offset); \
247} \ 247} \
248static ssize_t set_in##offset##_max (struct device *dev, \ 248static ssize_t set_in##offset##_max (struct device *dev, struct device_attribute *attr, \
249 const char *buf, size_t count) \ 249 const char *buf, size_t count) \
250{ \ 250{ \
251 return set_in_max(dev, buf, count, offset); \ 251 return set_in_max(dev, buf, count, offset); \
@@ -264,19 +264,19 @@ show_in_offset(5);
264show_in_offset(6); 264show_in_offset(6);
265 265
266/* Temperature */ 266/* Temperature */
267static ssize_t show_temp(struct device *dev, char *buf) 267static ssize_t show_temp(struct device *dev, struct device_attribute *attr, char *buf)
268{ 268{
269 struct lm78_data *data = lm78_update_device(dev); 269 struct lm78_data *data = lm78_update_device(dev);
270 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp)); 270 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp));
271} 271}
272 272
273static ssize_t show_temp_over(struct device *dev, char *buf) 273static ssize_t show_temp_over(struct device *dev, struct device_attribute *attr, char *buf)
274{ 274{
275 struct lm78_data *data = lm78_update_device(dev); 275 struct lm78_data *data = lm78_update_device(dev);
276 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_over)); 276 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_over));
277} 277}
278 278
279static ssize_t set_temp_over(struct device *dev, const char *buf, size_t count) 279static ssize_t set_temp_over(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
280{ 280{
281 struct i2c_client *client = to_i2c_client(dev); 281 struct i2c_client *client = to_i2c_client(dev);
282 struct lm78_data *data = i2c_get_clientdata(client); 282 struct lm78_data *data = i2c_get_clientdata(client);
@@ -289,13 +289,13 @@ static ssize_t set_temp_over(struct device *dev, const char *buf, size_t count)
289 return count; 289 return count;
290} 290}
291 291
292static ssize_t show_temp_hyst(struct device *dev, char *buf) 292static ssize_t show_temp_hyst(struct device *dev, struct device_attribute *attr, char *buf)
293{ 293{
294 struct lm78_data *data = lm78_update_device(dev); 294 struct lm78_data *data = lm78_update_device(dev);
295 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_hyst)); 295 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_hyst));
296} 296}
297 297
298static ssize_t set_temp_hyst(struct device *dev, const char *buf, size_t count) 298static ssize_t set_temp_hyst(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
299{ 299{
300 struct i2c_client *client = to_i2c_client(dev); 300 struct i2c_client *client = to_i2c_client(dev);
301 struct lm78_data *data = i2c_get_clientdata(client); 301 struct lm78_data *data = i2c_get_clientdata(client);
@@ -398,19 +398,19 @@ static ssize_t set_fan_div(struct device *dev, const char *buf,
398} 398}
399 399
400#define show_fan_offset(offset) \ 400#define show_fan_offset(offset) \
401static ssize_t show_fan_##offset (struct device *dev, char *buf) \ 401static ssize_t show_fan_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
402{ \ 402{ \
403 return show_fan(dev, buf, offset - 1); \ 403 return show_fan(dev, buf, offset - 1); \
404} \ 404} \
405static ssize_t show_fan_##offset##_min (struct device *dev, char *buf) \ 405static ssize_t show_fan_##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \
406{ \ 406{ \
407 return show_fan_min(dev, buf, offset - 1); \ 407 return show_fan_min(dev, buf, offset - 1); \
408} \ 408} \
409static ssize_t show_fan_##offset##_div (struct device *dev, char *buf) \ 409static ssize_t show_fan_##offset##_div (struct device *dev, struct device_attribute *attr, char *buf) \
410{ \ 410{ \
411 return show_fan_div(dev, buf, offset - 1); \ 411 return show_fan_div(dev, buf, offset - 1); \
412} \ 412} \
413static ssize_t set_fan_##offset##_min (struct device *dev, \ 413static ssize_t set_fan_##offset##_min (struct device *dev, struct device_attribute *attr, \
414 const char *buf, size_t count) \ 414 const char *buf, size_t count) \
415{ \ 415{ \
416 return set_fan_min(dev, buf, count, offset - 1); \ 416 return set_fan_min(dev, buf, count, offset - 1); \
@@ -419,13 +419,13 @@ static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_fan_##offset, NULL);\
419static DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR, \ 419static DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR, \
420 show_fan_##offset##_min, set_fan_##offset##_min); 420 show_fan_##offset##_min, set_fan_##offset##_min);
421 421
422static ssize_t set_fan_1_div(struct device *dev, const char *buf, 422static ssize_t set_fan_1_div(struct device *dev, struct device_attribute *attr, const char *buf,
423 size_t count) 423 size_t count)
424{ 424{
425 return set_fan_div(dev, buf, count, 0) ; 425 return set_fan_div(dev, buf, count, 0) ;
426} 426}
427 427
428static ssize_t set_fan_2_div(struct device *dev, const char *buf, 428static ssize_t set_fan_2_div(struct device *dev, struct device_attribute *attr, const char *buf,
429 size_t count) 429 size_t count)
430{ 430{
431 return set_fan_div(dev, buf, count, 1) ; 431 return set_fan_div(dev, buf, count, 1) ;
@@ -443,7 +443,7 @@ static DEVICE_ATTR(fan2_div, S_IRUGO | S_IWUSR,
443static DEVICE_ATTR(fan3_div, S_IRUGO, show_fan_3_div, NULL); 443static DEVICE_ATTR(fan3_div, S_IRUGO, show_fan_3_div, NULL);
444 444
445/* VID */ 445/* VID */
446static ssize_t show_vid(struct device *dev, char *buf) 446static ssize_t show_vid(struct device *dev, struct device_attribute *attr, char *buf)
447{ 447{
448 struct lm78_data *data = lm78_update_device(dev); 448 struct lm78_data *data = lm78_update_device(dev);
449 return sprintf(buf, "%d\n", VID_FROM_REG(data->vid)); 449 return sprintf(buf, "%d\n", VID_FROM_REG(data->vid));
@@ -451,7 +451,7 @@ static ssize_t show_vid(struct device *dev, char *buf)
451static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid, NULL); 451static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid, NULL);
452 452
453/* Alarms */ 453/* Alarms */
454static ssize_t show_alarms(struct device *dev, char *buf) 454static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf)
455{ 455{
456 struct lm78_data *data = lm78_update_device(dev); 456 struct lm78_data *data = lm78_update_device(dev);
457 return sprintf(buf, "%u\n", data->alarms); 457 return sprintf(buf, "%u\n", data->alarms);
diff --git a/drivers/i2c/chips/lm80.c b/drivers/i2c/chips/lm80.c
index a72f431971bb..404057b70e90 100644
--- a/drivers/i2c/chips/lm80.c
+++ b/drivers/i2c/chips/lm80.c
@@ -156,7 +156,7 @@ static struct i2c_driver lm80_driver = {
156 */ 156 */
157 157
158#define show_in(suffix, value) \ 158#define show_in(suffix, value) \
159static ssize_t show_in_##suffix(struct device *dev, char *buf) \ 159static ssize_t show_in_##suffix(struct device *dev, struct device_attribute *attr, char *buf) \
160{ \ 160{ \
161 struct lm80_data *data = lm80_update_device(dev); \ 161 struct lm80_data *data = lm80_update_device(dev); \
162 return sprintf(buf, "%d\n", IN_FROM_REG(data->value)); \ 162 return sprintf(buf, "%d\n", IN_FROM_REG(data->value)); \
@@ -184,7 +184,7 @@ show_in(input5, in[5]);
184show_in(input6, in[6]); 184show_in(input6, in[6]);
185 185
186#define set_in(suffix, value, reg) \ 186#define set_in(suffix, value, reg) \
187static ssize_t set_in_##suffix(struct device *dev, const char *buf, \ 187static ssize_t set_in_##suffix(struct device *dev, struct device_attribute *attr, const char *buf, \
188 size_t count) \ 188 size_t count) \
189{ \ 189{ \
190 struct i2c_client *client = to_i2c_client(dev); \ 190 struct i2c_client *client = to_i2c_client(dev); \
@@ -213,7 +213,7 @@ set_in(max5, in_max[5], LM80_REG_IN_MAX(5));
213set_in(max6, in_max[6], LM80_REG_IN_MAX(6)); 213set_in(max6, in_max[6], LM80_REG_IN_MAX(6));
214 214
215#define show_fan(suffix, value, div) \ 215#define show_fan(suffix, value, div) \
216static ssize_t show_fan_##suffix(struct device *dev, char *buf) \ 216static ssize_t show_fan_##suffix(struct device *dev, struct device_attribute *attr, char *buf) \
217{ \ 217{ \
218 struct lm80_data *data = lm80_update_device(dev); \ 218 struct lm80_data *data = lm80_update_device(dev); \
219 return sprintf(buf, "%d\n", FAN_FROM_REG(data->value, \ 219 return sprintf(buf, "%d\n", FAN_FROM_REG(data->value, \
@@ -225,7 +225,7 @@ show_fan(input1, fan[0], fan_div[0]);
225show_fan(input2, fan[1], fan_div[1]); 225show_fan(input2, fan[1], fan_div[1]);
226 226
227#define show_fan_div(suffix, value) \ 227#define show_fan_div(suffix, value) \
228static ssize_t show_fan_div##suffix(struct device *dev, char *buf) \ 228static ssize_t show_fan_div##suffix(struct device *dev, struct device_attribute *attr, char *buf) \
229{ \ 229{ \
230 struct lm80_data *data = lm80_update_device(dev); \ 230 struct lm80_data *data = lm80_update_device(dev); \
231 return sprintf(buf, "%d\n", DIV_FROM_REG(data->value)); \ 231 return sprintf(buf, "%d\n", DIV_FROM_REG(data->value)); \
@@ -234,7 +234,7 @@ show_fan_div(1, fan_div[0]);
234show_fan_div(2, fan_div[1]); 234show_fan_div(2, fan_div[1]);
235 235
236#define set_fan(suffix, value, reg, div) \ 236#define set_fan(suffix, value, reg, div) \
237static ssize_t set_fan_##suffix(struct device *dev, const char *buf, \ 237static ssize_t set_fan_##suffix(struct device *dev, struct device_attribute *attr, const char *buf, \
238 size_t count) \ 238 size_t count) \
239{ \ 239{ \
240 struct i2c_client *client = to_i2c_client(dev); \ 240 struct i2c_client *client = to_i2c_client(dev); \
@@ -292,7 +292,7 @@ static ssize_t set_fan_div(struct device *dev, const char *buf,
292} 292}
293 293
294#define set_fan_div(number) \ 294#define set_fan_div(number) \
295static ssize_t set_fan_div##number(struct device *dev, const char *buf, \ 295static ssize_t set_fan_div##number(struct device *dev, struct device_attribute *attr, const char *buf, \
296 size_t count) \ 296 size_t count) \
297{ \ 297{ \
298 return set_fan_div(dev, buf, count, number - 1); \ 298 return set_fan_div(dev, buf, count, number - 1); \
@@ -300,14 +300,14 @@ static ssize_t set_fan_div##number(struct device *dev, const char *buf, \
300set_fan_div(1); 300set_fan_div(1);
301set_fan_div(2); 301set_fan_div(2);
302 302
303static ssize_t show_temp_input1(struct device *dev, char *buf) 303static ssize_t show_temp_input1(struct device *dev, struct device_attribute *attr, char *buf)
304{ 304{
305 struct lm80_data *data = lm80_update_device(dev); 305 struct lm80_data *data = lm80_update_device(dev);
306 return sprintf(buf, "%ld\n", TEMP_FROM_REG(data->temp)); 306 return sprintf(buf, "%ld\n", TEMP_FROM_REG(data->temp));
307} 307}
308 308
309#define show_temp(suffix, value) \ 309#define show_temp(suffix, value) \
310static ssize_t show_temp_##suffix(struct device *dev, char *buf) \ 310static ssize_t show_temp_##suffix(struct device *dev, struct device_attribute *attr, char *buf) \
311{ \ 311{ \
312 struct lm80_data *data = lm80_update_device(dev); \ 312 struct lm80_data *data = lm80_update_device(dev); \
313 return sprintf(buf, "%d\n", TEMP_LIMIT_FROM_REG(data->value)); \ 313 return sprintf(buf, "%d\n", TEMP_LIMIT_FROM_REG(data->value)); \
@@ -318,7 +318,7 @@ show_temp(os_max, temp_os_max);
318show_temp(os_hyst, temp_os_hyst); 318show_temp(os_hyst, temp_os_hyst);
319 319
320#define set_temp(suffix, value, reg) \ 320#define set_temp(suffix, value, reg) \
321static ssize_t set_temp_##suffix(struct device *dev, const char *buf, \ 321static ssize_t set_temp_##suffix(struct device *dev, struct device_attribute *attr, const char *buf, \
322 size_t count) \ 322 size_t count) \
323{ \ 323{ \
324 struct i2c_client *client = to_i2c_client(dev); \ 324 struct i2c_client *client = to_i2c_client(dev); \
@@ -336,7 +336,7 @@ set_temp(hot_hyst, temp_hot_hyst, LM80_REG_TEMP_HOT_HYST);
336set_temp(os_max, temp_os_max, LM80_REG_TEMP_OS_MAX); 336set_temp(os_max, temp_os_max, LM80_REG_TEMP_OS_MAX);
337set_temp(os_hyst, temp_os_hyst, LM80_REG_TEMP_OS_HYST); 337set_temp(os_hyst, temp_os_hyst, LM80_REG_TEMP_OS_HYST);
338 338
339static ssize_t show_alarms(struct device *dev, char *buf) 339static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf)
340{ 340{
341 struct lm80_data *data = lm80_update_device(dev); 341 struct lm80_data *data = lm80_update_device(dev);
342 return sprintf(buf, "%u\n", data->alarms); 342 return sprintf(buf, "%u\n", data->alarms);
diff --git a/drivers/i2c/chips/lm83.c b/drivers/i2c/chips/lm83.c
index 3dafe60766ad..4d6d7d21e14b 100644
--- a/drivers/i2c/chips/lm83.c
+++ b/drivers/i2c/chips/lm83.c
@@ -155,7 +155,7 @@ struct lm83_data {
155 */ 155 */
156 156
157#define show_temp(suffix, value) \ 157#define show_temp(suffix, value) \
158static ssize_t show_temp_##suffix(struct device *dev, char *buf) \ 158static ssize_t show_temp_##suffix(struct device *dev, struct device_attribute *attr, char *buf) \
159{ \ 159{ \
160 struct lm83_data *data = lm83_update_device(dev); \ 160 struct lm83_data *data = lm83_update_device(dev); \
161 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->value)); \ 161 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->value)); \
@@ -171,7 +171,7 @@ show_temp(high4, temp_high[3]);
171show_temp(crit, temp_crit); 171show_temp(crit, temp_crit);
172 172
173#define set_temp(suffix, value, reg) \ 173#define set_temp(suffix, value, reg) \
174static ssize_t set_temp_##suffix(struct device *dev, const char *buf, \ 174static ssize_t set_temp_##suffix(struct device *dev, struct device_attribute *attr, const char *buf, \
175 size_t count) \ 175 size_t count) \
176{ \ 176{ \
177 struct i2c_client *client = to_i2c_client(dev); \ 177 struct i2c_client *client = to_i2c_client(dev); \
@@ -190,7 +190,7 @@ set_temp(high3, temp_high[2], LM83_REG_W_REMOTE2_HIGH);
190set_temp(high4, temp_high[3], LM83_REG_W_REMOTE3_HIGH); 190set_temp(high4, temp_high[3], LM83_REG_W_REMOTE3_HIGH);
191set_temp(crit, temp_crit, LM83_REG_W_TCRIT); 191set_temp(crit, temp_crit, LM83_REG_W_TCRIT);
192 192
193static ssize_t show_alarms(struct device *dev, char *buf) 193static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf)
194{ 194{
195 struct lm83_data *data = lm83_update_device(dev); 195 struct lm83_data *data = lm83_update_device(dev);
196 return sprintf(buf, "%d\n", data->alarms); 196 return sprintf(buf, "%d\n", data->alarms);
diff --git a/drivers/i2c/chips/lm85.c b/drivers/i2c/chips/lm85.c
index b1a0dc5f6b34..b1976775b4ba 100644
--- a/drivers/i2c/chips/lm85.c
+++ b/drivers/i2c/chips/lm85.c
@@ -426,15 +426,15 @@ static ssize_t set_fan_min(struct device *dev, const char *buf,
426} 426}
427 427
428#define show_fan_offset(offset) \ 428#define show_fan_offset(offset) \
429static ssize_t show_fan_##offset (struct device *dev, char *buf) \ 429static ssize_t show_fan_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
430{ \ 430{ \
431 return show_fan(dev, buf, offset - 1); \ 431 return show_fan(dev, buf, offset - 1); \
432} \ 432} \
433static ssize_t show_fan_##offset##_min (struct device *dev, char *buf) \ 433static ssize_t show_fan_##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \
434{ \ 434{ \
435 return show_fan_min(dev, buf, offset - 1); \ 435 return show_fan_min(dev, buf, offset - 1); \
436} \ 436} \
437static ssize_t set_fan_##offset##_min (struct device *dev, \ 437static ssize_t set_fan_##offset##_min (struct device *dev, struct device_attribute *attr, \
438 const char *buf, size_t count) \ 438 const char *buf, size_t count) \
439{ \ 439{ \
440 return set_fan_min(dev, buf, count, offset - 1); \ 440 return set_fan_min(dev, buf, count, offset - 1); \
@@ -451,7 +451,7 @@ show_fan_offset(4);
451 451
452/* vid, vrm, alarms */ 452/* vid, vrm, alarms */
453 453
454static ssize_t show_vid_reg(struct device *dev, char *buf) 454static ssize_t show_vid_reg(struct device *dev, struct device_attribute *attr, char *buf)
455{ 455{
456 struct lm85_data *data = lm85_update_device(dev); 456 struct lm85_data *data = lm85_update_device(dev);
457 return sprintf(buf, "%ld\n", (long) vid_from_reg(data->vid, data->vrm)); 457 return sprintf(buf, "%ld\n", (long) vid_from_reg(data->vid, data->vrm));
@@ -459,13 +459,13 @@ static ssize_t show_vid_reg(struct device *dev, char *buf)
459 459
460static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid_reg, NULL); 460static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid_reg, NULL);
461 461
462static ssize_t show_vrm_reg(struct device *dev, char *buf) 462static ssize_t show_vrm_reg(struct device *dev, struct device_attribute *attr, char *buf)
463{ 463{
464 struct lm85_data *data = lm85_update_device(dev); 464 struct lm85_data *data = lm85_update_device(dev);
465 return sprintf(buf, "%ld\n", (long) data->vrm); 465 return sprintf(buf, "%ld\n", (long) data->vrm);
466} 466}
467 467
468static ssize_t store_vrm_reg(struct device *dev, const char *buf, size_t count) 468static ssize_t store_vrm_reg(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
469{ 469{
470 struct i2c_client *client = to_i2c_client(dev); 470 struct i2c_client *client = to_i2c_client(dev);
471 struct lm85_data *data = i2c_get_clientdata(client); 471 struct lm85_data *data = i2c_get_clientdata(client);
@@ -478,7 +478,7 @@ static ssize_t store_vrm_reg(struct device *dev, const char *buf, size_t count)
478 478
479static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm_reg, store_vrm_reg); 479static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm_reg, store_vrm_reg);
480 480
481static ssize_t show_alarms_reg(struct device *dev, char *buf) 481static ssize_t show_alarms_reg(struct device *dev, struct device_attribute *attr, char *buf)
482{ 482{
483 struct lm85_data *data = lm85_update_device(dev); 483 struct lm85_data *data = lm85_update_device(dev);
484 return sprintf(buf, "%ld\n", (long) ALARMS_FROM_REG(data->alarms)); 484 return sprintf(buf, "%ld\n", (long) ALARMS_FROM_REG(data->alarms));
@@ -516,16 +516,16 @@ static ssize_t show_pwm_enable(struct device *dev, char *buf, int nr)
516} 516}
517 517
518#define show_pwm_reg(offset) \ 518#define show_pwm_reg(offset) \
519static ssize_t show_pwm_##offset (struct device *dev, char *buf) \ 519static ssize_t show_pwm_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
520{ \ 520{ \
521 return show_pwm(dev, buf, offset - 1); \ 521 return show_pwm(dev, buf, offset - 1); \
522} \ 522} \
523static ssize_t set_pwm_##offset (struct device *dev, \ 523static ssize_t set_pwm_##offset (struct device *dev, struct device_attribute *attr, \
524 const char *buf, size_t count) \ 524 const char *buf, size_t count) \
525{ \ 525{ \
526 return set_pwm(dev, buf, count, offset - 1); \ 526 return set_pwm(dev, buf, count, offset - 1); \
527} \ 527} \
528static ssize_t show_pwm_enable##offset (struct device *dev, char *buf) \ 528static ssize_t show_pwm_enable##offset (struct device *dev, struct device_attribute *attr, char *buf) \
529{ \ 529{ \
530 return show_pwm_enable(dev, buf, offset - 1); \ 530 return show_pwm_enable(dev, buf, offset - 1); \
531} \ 531} \
@@ -585,24 +585,24 @@ static ssize_t set_in_max(struct device *dev, const char *buf,
585 return count; 585 return count;
586} 586}
587#define show_in_reg(offset) \ 587#define show_in_reg(offset) \
588static ssize_t show_in_##offset (struct device *dev, char *buf) \ 588static ssize_t show_in_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
589{ \ 589{ \
590 return show_in(dev, buf, offset); \ 590 return show_in(dev, buf, offset); \
591} \ 591} \
592static ssize_t show_in_##offset##_min (struct device *dev, char *buf) \ 592static ssize_t show_in_##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \
593{ \ 593{ \
594 return show_in_min(dev, buf, offset); \ 594 return show_in_min(dev, buf, offset); \
595} \ 595} \
596static ssize_t show_in_##offset##_max (struct device *dev, char *buf) \ 596static ssize_t show_in_##offset##_max (struct device *dev, struct device_attribute *attr, char *buf) \
597{ \ 597{ \
598 return show_in_max(dev, buf, offset); \ 598 return show_in_max(dev, buf, offset); \
599} \ 599} \
600static ssize_t set_in_##offset##_min (struct device *dev, \ 600static ssize_t set_in_##offset##_min (struct device *dev, struct device_attribute *attr, \
601 const char *buf, size_t count) \ 601 const char *buf, size_t count) \
602{ \ 602{ \
603 return set_in_min(dev, buf, count, offset); \ 603 return set_in_min(dev, buf, count, offset); \
604} \ 604} \
605static ssize_t set_in_##offset##_max (struct device *dev, \ 605static ssize_t set_in_##offset##_max (struct device *dev, struct device_attribute *attr, \
606 const char *buf, size_t count) \ 606 const char *buf, size_t count) \
607{ \ 607{ \
608 return set_in_max(dev, buf, count, offset); \ 608 return set_in_max(dev, buf, count, offset); \
@@ -666,24 +666,24 @@ static ssize_t set_temp_max(struct device *dev, const char *buf,
666 return count; 666 return count;
667} 667}
668#define show_temp_reg(offset) \ 668#define show_temp_reg(offset) \
669static ssize_t show_temp_##offset (struct device *dev, char *buf) \ 669static ssize_t show_temp_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
670{ \ 670{ \
671 return show_temp(dev, buf, offset - 1); \ 671 return show_temp(dev, buf, offset - 1); \
672} \ 672} \
673static ssize_t show_temp_##offset##_min (struct device *dev, char *buf) \ 673static ssize_t show_temp_##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \
674{ \ 674{ \
675 return show_temp_min(dev, buf, offset - 1); \ 675 return show_temp_min(dev, buf, offset - 1); \
676} \ 676} \
677static ssize_t show_temp_##offset##_max (struct device *dev, char *buf) \ 677static ssize_t show_temp_##offset##_max (struct device *dev, struct device_attribute *attr, char *buf) \
678{ \ 678{ \
679 return show_temp_max(dev, buf, offset - 1); \ 679 return show_temp_max(dev, buf, offset - 1); \
680} \ 680} \
681static ssize_t set_temp_##offset##_min (struct device *dev, \ 681static ssize_t set_temp_##offset##_min (struct device *dev, struct device_attribute *attr, \
682 const char *buf, size_t count) \ 682 const char *buf, size_t count) \
683{ \ 683{ \
684 return set_temp_min(dev, buf, count, offset - 1); \ 684 return set_temp_min(dev, buf, count, offset - 1); \
685} \ 685} \
686static ssize_t set_temp_##offset##_max (struct device *dev, \ 686static ssize_t set_temp_##offset##_max (struct device *dev, struct device_attribute *attr, \
687 const char *buf, size_t count) \ 687 const char *buf, size_t count) \
688{ \ 688{ \
689 return set_temp_max(dev, buf, count, offset - 1); \ 689 return set_temp_max(dev, buf, count, offset - 1); \
@@ -786,42 +786,42 @@ static ssize_t set_pwm_auto_pwm_freq(struct device *dev, const char *buf,
786 return count; 786 return count;
787} 787}
788#define pwm_auto(offset) \ 788#define pwm_auto(offset) \
789static ssize_t show_pwm##offset##_auto_channels (struct device *dev, \ 789static ssize_t show_pwm##offset##_auto_channels (struct device *dev, struct device_attribute *attr, \
790 char *buf) \ 790 char *buf) \
791{ \ 791{ \
792 return show_pwm_auto_channels(dev, buf, offset - 1); \ 792 return show_pwm_auto_channels(dev, buf, offset - 1); \
793} \ 793} \
794static ssize_t set_pwm##offset##_auto_channels (struct device *dev, \ 794static ssize_t set_pwm##offset##_auto_channels (struct device *dev, struct device_attribute *attr, \
795 const char *buf, size_t count) \ 795 const char *buf, size_t count) \
796{ \ 796{ \
797 return set_pwm_auto_channels(dev, buf, count, offset - 1); \ 797 return set_pwm_auto_channels(dev, buf, count, offset - 1); \
798} \ 798} \
799static ssize_t show_pwm##offset##_auto_pwm_min (struct device *dev, \ 799static ssize_t show_pwm##offset##_auto_pwm_min (struct device *dev, struct device_attribute *attr, \
800 char *buf) \ 800 char *buf) \
801{ \ 801{ \
802 return show_pwm_auto_pwm_min(dev, buf, offset - 1); \ 802 return show_pwm_auto_pwm_min(dev, buf, offset - 1); \
803} \ 803} \
804static ssize_t set_pwm##offset##_auto_pwm_min (struct device *dev, \ 804static ssize_t set_pwm##offset##_auto_pwm_min (struct device *dev, struct device_attribute *attr, \
805 const char *buf, size_t count) \ 805 const char *buf, size_t count) \
806{ \ 806{ \
807 return set_pwm_auto_pwm_min(dev, buf, count, offset - 1); \ 807 return set_pwm_auto_pwm_min(dev, buf, count, offset - 1); \
808} \ 808} \
809static ssize_t show_pwm##offset##_auto_pwm_minctl (struct device *dev, \ 809static ssize_t show_pwm##offset##_auto_pwm_minctl (struct device *dev, struct device_attribute *attr, \
810 char *buf) \ 810 char *buf) \
811{ \ 811{ \
812 return show_pwm_auto_pwm_minctl(dev, buf, offset - 1); \ 812 return show_pwm_auto_pwm_minctl(dev, buf, offset - 1); \
813} \ 813} \
814static ssize_t set_pwm##offset##_auto_pwm_minctl (struct device *dev, \ 814static ssize_t set_pwm##offset##_auto_pwm_minctl (struct device *dev, struct device_attribute *attr, \
815 const char *buf, size_t count) \ 815 const char *buf, size_t count) \
816{ \ 816{ \
817 return set_pwm_auto_pwm_minctl(dev, buf, count, offset - 1); \ 817 return set_pwm_auto_pwm_minctl(dev, buf, count, offset - 1); \
818} \ 818} \
819static ssize_t show_pwm##offset##_auto_pwm_freq (struct device *dev, \ 819static ssize_t show_pwm##offset##_auto_pwm_freq (struct device *dev, struct device_attribute *attr, \
820 char *buf) \ 820 char *buf) \
821{ \ 821{ \
822 return show_pwm_auto_pwm_freq(dev, buf, offset - 1); \ 822 return show_pwm_auto_pwm_freq(dev, buf, offset - 1); \
823} \ 823} \
824static ssize_t set_pwm##offset##_auto_pwm_freq(struct device *dev, \ 824static ssize_t set_pwm##offset##_auto_pwm_freq(struct device *dev, struct device_attribute *attr, \
825 const char *buf, size_t count) \ 825 const char *buf, size_t count) \
826{ \ 826{ \
827 return set_pwm_auto_pwm_freq(dev, buf, count, offset - 1); \ 827 return set_pwm_auto_pwm_freq(dev, buf, count, offset - 1); \
@@ -962,42 +962,42 @@ static ssize_t set_temp_auto_temp_crit(struct device *dev, const char *buf,
962 return count; 962 return count;
963} 963}
964#define temp_auto(offset) \ 964#define temp_auto(offset) \
965static ssize_t show_temp##offset##_auto_temp_off (struct device *dev, \ 965static ssize_t show_temp##offset##_auto_temp_off (struct device *dev, struct device_attribute *attr, \
966 char *buf) \ 966 char *buf) \
967{ \ 967{ \
968 return show_temp_auto_temp_off(dev, buf, offset - 1); \ 968 return show_temp_auto_temp_off(dev, buf, offset - 1); \
969} \ 969} \
970static ssize_t set_temp##offset##_auto_temp_off (struct device *dev, \ 970static ssize_t set_temp##offset##_auto_temp_off (struct device *dev, struct device_attribute *attr, \
971 const char *buf, size_t count) \ 971 const char *buf, size_t count) \
972{ \ 972{ \
973 return set_temp_auto_temp_off(dev, buf, count, offset - 1); \ 973 return set_temp_auto_temp_off(dev, buf, count, offset - 1); \
974} \ 974} \
975static ssize_t show_temp##offset##_auto_temp_min (struct device *dev, \ 975static ssize_t show_temp##offset##_auto_temp_min (struct device *dev, struct device_attribute *attr, \
976 char *buf) \ 976 char *buf) \
977{ \ 977{ \
978 return show_temp_auto_temp_min(dev, buf, offset - 1); \ 978 return show_temp_auto_temp_min(dev, buf, offset - 1); \
979} \ 979} \
980static ssize_t set_temp##offset##_auto_temp_min (struct device *dev, \ 980static ssize_t set_temp##offset##_auto_temp_min (struct device *dev, struct device_attribute *attr, \
981 const char *buf, size_t count) \ 981 const char *buf, size_t count) \
982{ \ 982{ \
983 return set_temp_auto_temp_min(dev, buf, count, offset - 1); \ 983 return set_temp_auto_temp_min(dev, buf, count, offset - 1); \
984} \ 984} \
985static ssize_t show_temp##offset##_auto_temp_max (struct device *dev, \ 985static ssize_t show_temp##offset##_auto_temp_max (struct device *dev, struct device_attribute *attr, \
986 char *buf) \ 986 char *buf) \
987{ \ 987{ \
988 return show_temp_auto_temp_max(dev, buf, offset - 1); \ 988 return show_temp_auto_temp_max(dev, buf, offset - 1); \
989} \ 989} \
990static ssize_t set_temp##offset##_auto_temp_max (struct device *dev, \ 990static ssize_t set_temp##offset##_auto_temp_max (struct device *dev, struct device_attribute *attr, \
991 const char *buf, size_t count) \ 991 const char *buf, size_t count) \
992{ \ 992{ \
993 return set_temp_auto_temp_max(dev, buf, count, offset - 1); \ 993 return set_temp_auto_temp_max(dev, buf, count, offset - 1); \
994} \ 994} \
995static ssize_t show_temp##offset##_auto_temp_crit (struct device *dev, \ 995static ssize_t show_temp##offset##_auto_temp_crit (struct device *dev, struct device_attribute *attr, \
996 char *buf) \ 996 char *buf) \
997{ \ 997{ \
998 return show_temp_auto_temp_crit(dev, buf, offset - 1); \ 998 return show_temp_auto_temp_crit(dev, buf, offset - 1); \
999} \ 999} \
1000static ssize_t set_temp##offset##_auto_temp_crit (struct device *dev, \ 1000static ssize_t set_temp##offset##_auto_temp_crit (struct device *dev, struct device_attribute *attr, \
1001 const char *buf, size_t count) \ 1001 const char *buf, size_t count) \
1002{ \ 1002{ \
1003 return set_temp_auto_temp_crit(dev, buf, count, offset - 1); \ 1003 return set_temp_auto_temp_crit(dev, buf, count, offset - 1); \
diff --git a/drivers/i2c/chips/lm87.c b/drivers/i2c/chips/lm87.c
index 98cabd665063..4372b61a0882 100644
--- a/drivers/i2c/chips/lm87.c
+++ b/drivers/i2c/chips/lm87.c
@@ -218,19 +218,19 @@ static inline int lm87_write_value(struct i2c_client *client, u8 reg, u8 value)
218} 218}
219 219
220#define show_in(offset) \ 220#define show_in(offset) \
221static ssize_t show_in##offset##_input(struct device *dev, char *buf) \ 221static ssize_t show_in##offset##_input(struct device *dev, struct device_attribute *attr, char *buf) \
222{ \ 222{ \
223 struct lm87_data *data = lm87_update_device(dev); \ 223 struct lm87_data *data = lm87_update_device(dev); \
224 return sprintf(buf, "%u\n", IN_FROM_REG(data->in[offset], \ 224 return sprintf(buf, "%u\n", IN_FROM_REG(data->in[offset], \
225 data->in_scale[offset])); \ 225 data->in_scale[offset])); \
226} \ 226} \
227static ssize_t show_in##offset##_min(struct device *dev, char *buf) \ 227static ssize_t show_in##offset##_min(struct device *dev, struct device_attribute *attr, char *buf) \
228{ \ 228{ \
229 struct lm87_data *data = lm87_update_device(dev); \ 229 struct lm87_data *data = lm87_update_device(dev); \
230 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_min[offset], \ 230 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_min[offset], \
231 data->in_scale[offset])); \ 231 data->in_scale[offset])); \
232} \ 232} \
233static ssize_t show_in##offset##_max(struct device *dev, char *buf) \ 233static ssize_t show_in##offset##_max(struct device *dev, struct device_attribute *attr, char *buf) \
234{ \ 234{ \
235 struct lm87_data *data = lm87_update_device(dev); \ 235 struct lm87_data *data = lm87_update_device(dev); \
236 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_max[offset], \ 236 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_max[offset], \
@@ -274,13 +274,13 @@ static void set_in_max(struct device *dev, const char *buf, int nr)
274} 274}
275 275
276#define set_in(offset) \ 276#define set_in(offset) \
277static ssize_t set_in##offset##_min(struct device *dev, \ 277static ssize_t set_in##offset##_min(struct device *dev, struct device_attribute *attr, \
278 const char *buf, size_t count) \ 278 const char *buf, size_t count) \
279{ \ 279{ \
280 set_in_min(dev, buf, offset); \ 280 set_in_min(dev, buf, offset); \
281 return count; \ 281 return count; \
282} \ 282} \
283static ssize_t set_in##offset##_max(struct device *dev, \ 283static ssize_t set_in##offset##_max(struct device *dev, struct device_attribute *attr, \
284 const char *buf, size_t count) \ 284 const char *buf, size_t count) \
285{ \ 285{ \
286 set_in_max(dev, buf, offset); \ 286 set_in_max(dev, buf, offset); \
@@ -300,17 +300,17 @@ set_in(6);
300set_in(7); 300set_in(7);
301 301
302#define show_temp(offset) \ 302#define show_temp(offset) \
303static ssize_t show_temp##offset##_input(struct device *dev, char *buf) \ 303static ssize_t show_temp##offset##_input(struct device *dev, struct device_attribute *attr, char *buf) \
304{ \ 304{ \
305 struct lm87_data *data = lm87_update_device(dev); \ 305 struct lm87_data *data = lm87_update_device(dev); \
306 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp[offset-1])); \ 306 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp[offset-1])); \
307} \ 307} \
308static ssize_t show_temp##offset##_low(struct device *dev, char *buf) \ 308static ssize_t show_temp##offset##_low(struct device *dev, struct device_attribute *attr, char *buf) \
309{ \ 309{ \
310 struct lm87_data *data = lm87_update_device(dev); \ 310 struct lm87_data *data = lm87_update_device(dev); \
311 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_low[offset-1])); \ 311 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_low[offset-1])); \
312} \ 312} \
313static ssize_t show_temp##offset##_high(struct device *dev, char *buf) \ 313static ssize_t show_temp##offset##_high(struct device *dev, struct device_attribute *attr, char *buf) \
314{ \ 314{ \
315 struct lm87_data *data = lm87_update_device(dev); \ 315 struct lm87_data *data = lm87_update_device(dev); \
316 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_high[offset-1])); \ 316 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_high[offset-1])); \
@@ -346,13 +346,13 @@ static void set_temp_high(struct device *dev, const char *buf, int nr)
346} 346}
347 347
348#define set_temp(offset) \ 348#define set_temp(offset) \
349static ssize_t set_temp##offset##_low(struct device *dev, \ 349static ssize_t set_temp##offset##_low(struct device *dev, struct device_attribute *attr, \
350 const char *buf, size_t count) \ 350 const char *buf, size_t count) \
351{ \ 351{ \
352 set_temp_low(dev, buf, offset-1); \ 352 set_temp_low(dev, buf, offset-1); \
353 return count; \ 353 return count; \
354} \ 354} \
355static ssize_t set_temp##offset##_high(struct device *dev, \ 355static ssize_t set_temp##offset##_high(struct device *dev, struct device_attribute *attr, \
356 const char *buf, size_t count) \ 356 const char *buf, size_t count) \
357{ \ 357{ \
358 set_temp_high(dev, buf, offset-1); \ 358 set_temp_high(dev, buf, offset-1); \
@@ -366,13 +366,13 @@ set_temp(1);
366set_temp(2); 366set_temp(2);
367set_temp(3); 367set_temp(3);
368 368
369static ssize_t show_temp_crit_int(struct device *dev, char *buf) 369static ssize_t show_temp_crit_int(struct device *dev, struct device_attribute *attr, char *buf)
370{ 370{
371 struct lm87_data *data = lm87_update_device(dev); 371 struct lm87_data *data = lm87_update_device(dev);
372 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_crit_int)); 372 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_crit_int));
373} 373}
374 374
375static ssize_t show_temp_crit_ext(struct device *dev, char *buf) 375static ssize_t show_temp_crit_ext(struct device *dev, struct device_attribute *attr, char *buf)
376{ 376{
377 struct lm87_data *data = lm87_update_device(dev); 377 struct lm87_data *data = lm87_update_device(dev);
378 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_crit_ext)); 378 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_crit_ext));
@@ -383,19 +383,19 @@ static DEVICE_ATTR(temp2_crit, S_IRUGO, show_temp_crit_ext, NULL);
383static DEVICE_ATTR(temp3_crit, S_IRUGO, show_temp_crit_ext, NULL); 383static DEVICE_ATTR(temp3_crit, S_IRUGO, show_temp_crit_ext, NULL);
384 384
385#define show_fan(offset) \ 385#define show_fan(offset) \
386static ssize_t show_fan##offset##_input(struct device *dev, char *buf) \ 386static ssize_t show_fan##offset##_input(struct device *dev, struct device_attribute *attr, char *buf) \
387{ \ 387{ \
388 struct lm87_data *data = lm87_update_device(dev); \ 388 struct lm87_data *data = lm87_update_device(dev); \
389 return sprintf(buf, "%d\n", FAN_FROM_REG(data->fan[offset-1], \ 389 return sprintf(buf, "%d\n", FAN_FROM_REG(data->fan[offset-1], \
390 FAN_DIV_FROM_REG(data->fan_div[offset-1]))); \ 390 FAN_DIV_FROM_REG(data->fan_div[offset-1]))); \
391} \ 391} \
392static ssize_t show_fan##offset##_min(struct device *dev, char *buf) \ 392static ssize_t show_fan##offset##_min(struct device *dev, struct device_attribute *attr, char *buf) \
393{ \ 393{ \
394 struct lm87_data *data = lm87_update_device(dev); \ 394 struct lm87_data *data = lm87_update_device(dev); \
395 return sprintf(buf, "%d\n", FAN_FROM_REG(data->fan_min[offset-1], \ 395 return sprintf(buf, "%d\n", FAN_FROM_REG(data->fan_min[offset-1], \
396 FAN_DIV_FROM_REG(data->fan_div[offset-1]))); \ 396 FAN_DIV_FROM_REG(data->fan_div[offset-1]))); \
397} \ 397} \
398static ssize_t show_fan##offset##_div(struct device *dev, char *buf) \ 398static ssize_t show_fan##offset##_div(struct device *dev, struct device_attribute *attr, char *buf) \
399{ \ 399{ \
400 struct lm87_data *data = lm87_update_device(dev); \ 400 struct lm87_data *data = lm87_update_device(dev); \
401 return sprintf(buf, "%d\n", FAN_DIV_FROM_REG(data->fan_div[offset-1])); \ 401 return sprintf(buf, "%d\n", FAN_DIV_FROM_REG(data->fan_div[offset-1])); \
@@ -465,13 +465,13 @@ static ssize_t set_fan_div(struct device *dev, const char *buf,
465} 465}
466 466
467#define set_fan(offset) \ 467#define set_fan(offset) \
468static ssize_t set_fan##offset##_min(struct device *dev, const char *buf, \ 468static ssize_t set_fan##offset##_min(struct device *dev, struct device_attribute *attr, const char *buf, \
469 size_t count) \ 469 size_t count) \
470{ \ 470{ \
471 set_fan_min(dev, buf, offset-1); \ 471 set_fan_min(dev, buf, offset-1); \
472 return count; \ 472 return count; \
473} \ 473} \
474static ssize_t set_fan##offset##_div(struct device *dev, const char *buf, \ 474static ssize_t set_fan##offset##_div(struct device *dev, struct device_attribute *attr, const char *buf, \
475 size_t count) \ 475 size_t count) \
476{ \ 476{ \
477 return set_fan_div(dev, buf, count, offset-1); \ 477 return set_fan_div(dev, buf, count, offset-1); \
@@ -483,26 +483,26 @@ static DEVICE_ATTR(fan##offset##_div, S_IRUGO | S_IWUSR, \
483set_fan(1); 483set_fan(1);
484set_fan(2); 484set_fan(2);
485 485
486static ssize_t show_alarms(struct device *dev, char *buf) 486static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf)
487{ 487{
488 struct lm87_data *data = lm87_update_device(dev); 488 struct lm87_data *data = lm87_update_device(dev);
489 return sprintf(buf, "%d\n", data->alarms); 489 return sprintf(buf, "%d\n", data->alarms);
490} 490}
491static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL); 491static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL);
492 492
493static ssize_t show_vid(struct device *dev, char *buf) 493static ssize_t show_vid(struct device *dev, struct device_attribute *attr, char *buf)
494{ 494{
495 struct lm87_data *data = lm87_update_device(dev); 495 struct lm87_data *data = lm87_update_device(dev);
496 return sprintf(buf, "%d\n", vid_from_reg(data->vid, data->vrm)); 496 return sprintf(buf, "%d\n", vid_from_reg(data->vid, data->vrm));
497} 497}
498static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid, NULL); 498static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid, NULL);
499 499
500static ssize_t show_vrm(struct device *dev, char *buf) 500static ssize_t show_vrm(struct device *dev, struct device_attribute *attr, char *buf)
501{ 501{
502 struct lm87_data *data = lm87_update_device(dev); 502 struct lm87_data *data = lm87_update_device(dev);
503 return sprintf(buf, "%d\n", data->vrm); 503 return sprintf(buf, "%d\n", data->vrm);
504} 504}
505static ssize_t set_vrm(struct device *dev, const char *buf, size_t count) 505static ssize_t set_vrm(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
506{ 506{
507 struct i2c_client *client = to_i2c_client(dev); 507 struct i2c_client *client = to_i2c_client(dev);
508 struct lm87_data *data = i2c_get_clientdata(client); 508 struct lm87_data *data = i2c_get_clientdata(client);
@@ -511,12 +511,12 @@ static ssize_t set_vrm(struct device *dev, const char *buf, size_t count)
511} 511}
512static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm, set_vrm); 512static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm, set_vrm);
513 513
514static ssize_t show_aout(struct device *dev, char *buf) 514static ssize_t show_aout(struct device *dev, struct device_attribute *attr, char *buf)
515{ 515{
516 struct lm87_data *data = lm87_update_device(dev); 516 struct lm87_data *data = lm87_update_device(dev);
517 return sprintf(buf, "%d\n", AOUT_FROM_REG(data->aout)); 517 return sprintf(buf, "%d\n", AOUT_FROM_REG(data->aout));
518} 518}
519static ssize_t set_aout(struct device *dev, const char *buf, size_t count) 519static ssize_t set_aout(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
520{ 520{
521 struct i2c_client *client = to_i2c_client(dev); 521 struct i2c_client *client = to_i2c_client(dev);
522 struct lm87_data *data = i2c_get_clientdata(client); 522 struct lm87_data *data = i2c_get_clientdata(client);
diff --git a/drivers/i2c/chips/lm90.c b/drivers/i2c/chips/lm90.c
index 2c00ff83babc..9b127a07f56b 100644
--- a/drivers/i2c/chips/lm90.c
+++ b/drivers/i2c/chips/lm90.c
@@ -218,7 +218,7 @@ struct lm90_data {
218 */ 218 */
219 219
220#define show_temp(value, converter) \ 220#define show_temp(value, converter) \
221static ssize_t show_##value(struct device *dev, char *buf) \ 221static ssize_t show_##value(struct device *dev, struct device_attribute *attr, char *buf) \
222{ \ 222{ \
223 struct lm90_data *data = lm90_update_device(dev); \ 223 struct lm90_data *data = lm90_update_device(dev); \
224 return sprintf(buf, "%d\n", converter(data->value)); \ 224 return sprintf(buf, "%d\n", converter(data->value)); \
@@ -233,7 +233,7 @@ show_temp(temp_crit1, TEMP1_FROM_REG);
233show_temp(temp_crit2, TEMP1_FROM_REG); 233show_temp(temp_crit2, TEMP1_FROM_REG);
234 234
235#define set_temp1(value, reg) \ 235#define set_temp1(value, reg) \
236static ssize_t set_##value(struct device *dev, const char *buf, \ 236static ssize_t set_##value(struct device *dev, struct device_attribute *attr, const char *buf, \
237 size_t count) \ 237 size_t count) \
238{ \ 238{ \
239 struct i2c_client *client = to_i2c_client(dev); \ 239 struct i2c_client *client = to_i2c_client(dev); \
@@ -250,7 +250,7 @@ static ssize_t set_##value(struct device *dev, const char *buf, \
250 return count; \ 250 return count; \
251} 251}
252#define set_temp2(value, regh, regl) \ 252#define set_temp2(value, regh, regl) \
253static ssize_t set_##value(struct device *dev, const char *buf, \ 253static ssize_t set_##value(struct device *dev, struct device_attribute *attr, const char *buf, \
254 size_t count) \ 254 size_t count) \
255{ \ 255{ \
256 struct i2c_client *client = to_i2c_client(dev); \ 256 struct i2c_client *client = to_i2c_client(dev); \
@@ -275,7 +275,7 @@ set_temp1(temp_crit1, LM90_REG_W_LOCAL_CRIT);
275set_temp1(temp_crit2, LM90_REG_W_REMOTE_CRIT); 275set_temp1(temp_crit2, LM90_REG_W_REMOTE_CRIT);
276 276
277#define show_temp_hyst(value, basereg) \ 277#define show_temp_hyst(value, basereg) \
278static ssize_t show_##value(struct device *dev, char *buf) \ 278static ssize_t show_##value(struct device *dev, struct device_attribute *attr, char *buf) \
279{ \ 279{ \
280 struct lm90_data *data = lm90_update_device(dev); \ 280 struct lm90_data *data = lm90_update_device(dev); \
281 return sprintf(buf, "%d\n", TEMP1_FROM_REG(data->basereg) \ 281 return sprintf(buf, "%d\n", TEMP1_FROM_REG(data->basereg) \
@@ -284,7 +284,7 @@ static ssize_t show_##value(struct device *dev, char *buf) \
284show_temp_hyst(temp_hyst1, temp_crit1); 284show_temp_hyst(temp_hyst1, temp_crit1);
285show_temp_hyst(temp_hyst2, temp_crit2); 285show_temp_hyst(temp_hyst2, temp_crit2);
286 286
287static ssize_t set_temp_hyst1(struct device *dev, const char *buf, 287static ssize_t set_temp_hyst1(struct device *dev, struct device_attribute *attr, const char *buf,
288 size_t count) 288 size_t count)
289{ 289{
290 struct i2c_client *client = to_i2c_client(dev); 290 struct i2c_client *client = to_i2c_client(dev);
@@ -300,7 +300,7 @@ static ssize_t set_temp_hyst1(struct device *dev, const char *buf,
300 return count; 300 return count;
301} 301}
302 302
303static ssize_t show_alarms(struct device *dev, char *buf) 303static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf)
304{ 304{
305 struct lm90_data *data = lm90_update_device(dev); 305 struct lm90_data *data = lm90_update_device(dev);
306 return sprintf(buf, "%d\n", data->alarms); 306 return sprintf(buf, "%d\n", data->alarms);
diff --git a/drivers/i2c/chips/lm92.c b/drivers/i2c/chips/lm92.c
index fe6e83d70a72..215c8e40ffdd 100644
--- a/drivers/i2c/chips/lm92.c
+++ b/drivers/i2c/chips/lm92.c
@@ -140,7 +140,7 @@ static struct lm92_data *lm92_update_device(struct device *dev)
140} 140}
141 141
142#define show_temp(value) \ 142#define show_temp(value) \
143static ssize_t show_##value(struct device *dev, char *buf) \ 143static ssize_t show_##value(struct device *dev, struct device_attribute *attr, char *buf) \
144{ \ 144{ \
145 struct lm92_data *data = lm92_update_device(dev); \ 145 struct lm92_data *data = lm92_update_device(dev); \
146 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->value)); \ 146 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->value)); \
@@ -151,7 +151,7 @@ show_temp(temp1_min);
151show_temp(temp1_max); 151show_temp(temp1_max);
152 152
153#define set_temp(value, reg) \ 153#define set_temp(value, reg) \
154static ssize_t set_##value(struct device *dev, const char *buf, \ 154static ssize_t set_##value(struct device *dev, struct device_attribute *attr, const char *buf, \
155 size_t count) \ 155 size_t count) \
156{ \ 156{ \
157 struct i2c_client *client = to_i2c_client(dev); \ 157 struct i2c_client *client = to_i2c_client(dev); \
@@ -168,26 +168,26 @@ set_temp(temp1_crit, LM92_REG_TEMP_CRIT);
168set_temp(temp1_min, LM92_REG_TEMP_LOW); 168set_temp(temp1_min, LM92_REG_TEMP_LOW);
169set_temp(temp1_max, LM92_REG_TEMP_HIGH); 169set_temp(temp1_max, LM92_REG_TEMP_HIGH);
170 170
171static ssize_t show_temp1_crit_hyst(struct device *dev, char *buf) 171static ssize_t show_temp1_crit_hyst(struct device *dev, struct device_attribute *attr, char *buf)
172{ 172{
173 struct lm92_data *data = lm92_update_device(dev); 173 struct lm92_data *data = lm92_update_device(dev);
174 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp1_crit) 174 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp1_crit)
175 - TEMP_FROM_REG(data->temp1_hyst)); 175 - TEMP_FROM_REG(data->temp1_hyst));
176} 176}
177static ssize_t show_temp1_max_hyst(struct device *dev, char *buf) 177static ssize_t show_temp1_max_hyst(struct device *dev, struct device_attribute *attr, char *buf)
178{ 178{
179 struct lm92_data *data = lm92_update_device(dev); 179 struct lm92_data *data = lm92_update_device(dev);
180 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp1_max) 180 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp1_max)
181 - TEMP_FROM_REG(data->temp1_hyst)); 181 - TEMP_FROM_REG(data->temp1_hyst));
182} 182}
183static ssize_t show_temp1_min_hyst(struct device *dev, char *buf) 183static ssize_t show_temp1_min_hyst(struct device *dev, struct device_attribute *attr, char *buf)
184{ 184{
185 struct lm92_data *data = lm92_update_device(dev); 185 struct lm92_data *data = lm92_update_device(dev);
186 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp1_min) 186 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp1_min)
187 + TEMP_FROM_REG(data->temp1_hyst)); 187 + TEMP_FROM_REG(data->temp1_hyst));
188} 188}
189 189
190static ssize_t set_temp1_crit_hyst(struct device *dev, const char *buf, 190static ssize_t set_temp1_crit_hyst(struct device *dev, struct device_attribute *attr, const char *buf,
191 size_t count) 191 size_t count)
192{ 192{
193 struct i2c_client *client = to_i2c_client(dev); 193 struct i2c_client *client = to_i2c_client(dev);
@@ -202,7 +202,7 @@ static ssize_t set_temp1_crit_hyst(struct device *dev, const char *buf,
202 return count; 202 return count;
203} 203}
204 204
205static ssize_t show_alarms(struct device *dev, char *buf) 205static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf)
206{ 206{
207 struct lm92_data *data = lm92_update_device(dev); 207 struct lm92_data *data = lm92_update_device(dev);
208 return sprintf(buf, "%d\n", ALARMS_FROM_REG(data->temp1_input)); 208 return sprintf(buf, "%d\n", ALARMS_FROM_REG(data->temp1_input));
diff --git a/drivers/i2c/chips/max1619.c b/drivers/i2c/chips/max1619.c
index 5afa961a5e10..30a196155fd9 100644
--- a/drivers/i2c/chips/max1619.c
+++ b/drivers/i2c/chips/max1619.c
@@ -122,7 +122,7 @@ struct max1619_data {
122 */ 122 */
123 123
124#define show_temp(value) \ 124#define show_temp(value) \
125static ssize_t show_##value(struct device *dev, char *buf) \ 125static ssize_t show_##value(struct device *dev, struct device_attribute *attr, char *buf) \
126{ \ 126{ \
127 struct max1619_data *data = max1619_update_device(dev); \ 127 struct max1619_data *data = max1619_update_device(dev); \
128 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->value)); \ 128 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->value)); \
@@ -135,7 +135,7 @@ show_temp(temp_crit2);
135show_temp(temp_hyst2); 135show_temp(temp_hyst2);
136 136
137#define set_temp2(value, reg) \ 137#define set_temp2(value, reg) \
138static ssize_t set_##value(struct device *dev, const char *buf, \ 138static ssize_t set_##value(struct device *dev, struct device_attribute *attr, const char *buf, \
139 size_t count) \ 139 size_t count) \
140{ \ 140{ \
141 struct i2c_client *client = to_i2c_client(dev); \ 141 struct i2c_client *client = to_i2c_client(dev); \
@@ -154,7 +154,7 @@ set_temp2(temp_high2, MAX1619_REG_W_REMOTE_HIGH);
154set_temp2(temp_crit2, MAX1619_REG_W_REMOTE_CRIT); 154set_temp2(temp_crit2, MAX1619_REG_W_REMOTE_CRIT);
155set_temp2(temp_hyst2, MAX1619_REG_W_TCRIT_HYST); 155set_temp2(temp_hyst2, MAX1619_REG_W_TCRIT_HYST);
156 156
157static ssize_t show_alarms(struct device *dev, char *buf) 157static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf)
158{ 158{
159 struct max1619_data *data = max1619_update_device(dev); 159 struct max1619_data *data = max1619_update_device(dev);
160 return sprintf(buf, "%d\n", data->alarms); 160 return sprintf(buf, "%d\n", data->alarms);
diff --git a/drivers/i2c/chips/pc87360.c b/drivers/i2c/chips/pc87360.c
index 6d94c36c9218..65637b2cd170 100644
--- a/drivers/i2c/chips/pc87360.c
+++ b/drivers/i2c/chips/pc87360.c
@@ -282,31 +282,31 @@ static ssize_t set_fan_min(struct device *dev, const char *buf,
282} 282}
283 283
284#define show_and_set_fan(offset) \ 284#define show_and_set_fan(offset) \
285static ssize_t show_fan##offset##_input(struct device *dev, char *buf) \ 285static ssize_t show_fan##offset##_input(struct device *dev, struct device_attribute *attr, char *buf) \
286{ \ 286{ \
287 struct pc87360_data *data = pc87360_update_device(dev); \ 287 struct pc87360_data *data = pc87360_update_device(dev); \
288 return sprintf(buf, "%u\n", FAN_FROM_REG(data->fan[offset-1], \ 288 return sprintf(buf, "%u\n", FAN_FROM_REG(data->fan[offset-1], \
289 FAN_DIV_FROM_REG(data->fan_status[offset-1]))); \ 289 FAN_DIV_FROM_REG(data->fan_status[offset-1]))); \
290} \ 290} \
291static ssize_t show_fan##offset##_min(struct device *dev, char *buf) \ 291static ssize_t show_fan##offset##_min(struct device *dev, struct device_attribute *attr, char *buf) \
292{ \ 292{ \
293 struct pc87360_data *data = pc87360_update_device(dev); \ 293 struct pc87360_data *data = pc87360_update_device(dev); \
294 return sprintf(buf, "%u\n", FAN_FROM_REG(data->fan_min[offset-1], \ 294 return sprintf(buf, "%u\n", FAN_FROM_REG(data->fan_min[offset-1], \
295 FAN_DIV_FROM_REG(data->fan_status[offset-1]))); \ 295 FAN_DIV_FROM_REG(data->fan_status[offset-1]))); \
296} \ 296} \
297static ssize_t show_fan##offset##_div(struct device *dev, char *buf) \ 297static ssize_t show_fan##offset##_div(struct device *dev, struct device_attribute *attr, char *buf) \
298{ \ 298{ \
299 struct pc87360_data *data = pc87360_update_device(dev); \ 299 struct pc87360_data *data = pc87360_update_device(dev); \
300 return sprintf(buf, "%u\n", \ 300 return sprintf(buf, "%u\n", \
301 FAN_DIV_FROM_REG(data->fan_status[offset-1])); \ 301 FAN_DIV_FROM_REG(data->fan_status[offset-1])); \
302} \ 302} \
303static ssize_t show_fan##offset##_status(struct device *dev, char *buf) \ 303static ssize_t show_fan##offset##_status(struct device *dev, struct device_attribute *attr, char *buf) \
304{ \ 304{ \
305 struct pc87360_data *data = pc87360_update_device(dev); \ 305 struct pc87360_data *data = pc87360_update_device(dev); \
306 return sprintf(buf, "%u\n", \ 306 return sprintf(buf, "%u\n", \
307 FAN_STATUS_FROM_REG(data->fan_status[offset-1])); \ 307 FAN_STATUS_FROM_REG(data->fan_status[offset-1])); \
308} \ 308} \
309static ssize_t set_fan##offset##_min(struct device *dev, const char *buf, \ 309static ssize_t set_fan##offset##_min(struct device *dev, struct device_attribute *attr, const char *buf, \
310 size_t count) \ 310 size_t count) \
311{ \ 311{ \
312 return set_fan_min(dev, buf, count, offset-1); \ 312 return set_fan_min(dev, buf, count, offset-1); \
@@ -324,7 +324,7 @@ show_and_set_fan(2)
324show_and_set_fan(3) 324show_and_set_fan(3)
325 325
326#define show_and_set_pwm(offset) \ 326#define show_and_set_pwm(offset) \
327static ssize_t show_pwm##offset(struct device *dev, char *buf) \ 327static ssize_t show_pwm##offset(struct device *dev, struct device_attribute *attr, char *buf) \
328{ \ 328{ \
329 struct pc87360_data *data = pc87360_update_device(dev); \ 329 struct pc87360_data *data = pc87360_update_device(dev); \
330 return sprintf(buf, "%u\n", \ 330 return sprintf(buf, "%u\n", \
@@ -332,7 +332,7 @@ static ssize_t show_pwm##offset(struct device *dev, char *buf) \
332 FAN_CONFIG_INVERT(data->fan_conf, \ 332 FAN_CONFIG_INVERT(data->fan_conf, \
333 offset-1))); \ 333 offset-1))); \
334} \ 334} \
335static ssize_t set_pwm##offset(struct device *dev, const char *buf, \ 335static ssize_t set_pwm##offset(struct device *dev, struct device_attribute *attr, const char *buf, \
336 size_t count) \ 336 size_t count) \
337{ \ 337{ \
338 struct i2c_client *client = to_i2c_client(dev); \ 338 struct i2c_client *client = to_i2c_client(dev); \
@@ -354,30 +354,30 @@ show_and_set_pwm(2)
354show_and_set_pwm(3) 354show_and_set_pwm(3)
355 355
356#define show_and_set_in(offset) \ 356#define show_and_set_in(offset) \
357static ssize_t show_in##offset##_input(struct device *dev, char *buf) \ 357static ssize_t show_in##offset##_input(struct device *dev, struct device_attribute *attr, char *buf) \
358{ \ 358{ \
359 struct pc87360_data *data = pc87360_update_device(dev); \ 359 struct pc87360_data *data = pc87360_update_device(dev); \
360 return sprintf(buf, "%u\n", IN_FROM_REG(data->in[offset], \ 360 return sprintf(buf, "%u\n", IN_FROM_REG(data->in[offset], \
361 data->in_vref)); \ 361 data->in_vref)); \
362} \ 362} \
363static ssize_t show_in##offset##_min(struct device *dev, char *buf) \ 363static ssize_t show_in##offset##_min(struct device *dev, struct device_attribute *attr, char *buf) \
364{ \ 364{ \
365 struct pc87360_data *data = pc87360_update_device(dev); \ 365 struct pc87360_data *data = pc87360_update_device(dev); \
366 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_min[offset], \ 366 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_min[offset], \
367 data->in_vref)); \ 367 data->in_vref)); \
368} \ 368} \
369static ssize_t show_in##offset##_max(struct device *dev, char *buf) \ 369static ssize_t show_in##offset##_max(struct device *dev, struct device_attribute *attr, char *buf) \
370{ \ 370{ \
371 struct pc87360_data *data = pc87360_update_device(dev); \ 371 struct pc87360_data *data = pc87360_update_device(dev); \
372 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_max[offset], \ 372 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_max[offset], \
373 data->in_vref)); \ 373 data->in_vref)); \
374} \ 374} \
375static ssize_t show_in##offset##_status(struct device *dev, char *buf) \ 375static ssize_t show_in##offset##_status(struct device *dev, struct device_attribute *attr, char *buf) \
376{ \ 376{ \
377 struct pc87360_data *data = pc87360_update_device(dev); \ 377 struct pc87360_data *data = pc87360_update_device(dev); \
378 return sprintf(buf, "%u\n", data->in_status[offset]); \ 378 return sprintf(buf, "%u\n", data->in_status[offset]); \
379} \ 379} \
380static ssize_t set_in##offset##_min(struct device *dev, const char *buf, \ 380static ssize_t set_in##offset##_min(struct device *dev, struct device_attribute *attr, const char *buf, \
381 size_t count) \ 381 size_t count) \
382{ \ 382{ \
383 struct i2c_client *client = to_i2c_client(dev); \ 383 struct i2c_client *client = to_i2c_client(dev); \
@@ -391,7 +391,7 @@ static ssize_t set_in##offset##_min(struct device *dev, const char *buf, \
391 up(&data->update_lock); \ 391 up(&data->update_lock); \
392 return count; \ 392 return count; \
393} \ 393} \
394static ssize_t set_in##offset##_max(struct device *dev, const char *buf, \ 394static ssize_t set_in##offset##_max(struct device *dev, struct device_attribute *attr, const char *buf, \
395 size_t count) \ 395 size_t count) \
396{ \ 396{ \
397 struct i2c_client *client = to_i2c_client(dev); \ 397 struct i2c_client *client = to_i2c_client(dev); \
@@ -427,36 +427,36 @@ show_and_set_in(9)
427show_and_set_in(10) 427show_and_set_in(10)
428 428
429#define show_and_set_therm(offset) \ 429#define show_and_set_therm(offset) \
430static ssize_t show_temp##offset##_input(struct device *dev, char *buf) \ 430static ssize_t show_temp##offset##_input(struct device *dev, struct device_attribute *attr, char *buf) \
431{ \ 431{ \
432 struct pc87360_data *data = pc87360_update_device(dev); \ 432 struct pc87360_data *data = pc87360_update_device(dev); \
433 return sprintf(buf, "%u\n", IN_FROM_REG(data->in[offset+7], \ 433 return sprintf(buf, "%u\n", IN_FROM_REG(data->in[offset+7], \
434 data->in_vref)); \ 434 data->in_vref)); \
435} \ 435} \
436static ssize_t show_temp##offset##_min(struct device *dev, char *buf) \ 436static ssize_t show_temp##offset##_min(struct device *dev, struct device_attribute *attr, char *buf) \
437{ \ 437{ \
438 struct pc87360_data *data = pc87360_update_device(dev); \ 438 struct pc87360_data *data = pc87360_update_device(dev); \
439 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_min[offset+7], \ 439 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_min[offset+7], \
440 data->in_vref)); \ 440 data->in_vref)); \
441} \ 441} \
442static ssize_t show_temp##offset##_max(struct device *dev, char *buf) \ 442static ssize_t show_temp##offset##_max(struct device *dev, struct device_attribute *attr, char *buf) \
443{ \ 443{ \
444 struct pc87360_data *data = pc87360_update_device(dev); \ 444 struct pc87360_data *data = pc87360_update_device(dev); \
445 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_max[offset+7], \ 445 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_max[offset+7], \
446 data->in_vref)); \ 446 data->in_vref)); \
447} \ 447} \
448static ssize_t show_temp##offset##_crit(struct device *dev, char *buf) \ 448static ssize_t show_temp##offset##_crit(struct device *dev, struct device_attribute *attr, char *buf) \
449{ \ 449{ \
450 struct pc87360_data *data = pc87360_update_device(dev); \ 450 struct pc87360_data *data = pc87360_update_device(dev); \
451 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_crit[offset-4], \ 451 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_crit[offset-4], \
452 data->in_vref)); \ 452 data->in_vref)); \
453} \ 453} \
454static ssize_t show_temp##offset##_status(struct device *dev, char *buf) \ 454static ssize_t show_temp##offset##_status(struct device *dev, struct device_attribute *attr, char *buf) \
455{ \ 455{ \
456 struct pc87360_data *data = pc87360_update_device(dev); \ 456 struct pc87360_data *data = pc87360_update_device(dev); \
457 return sprintf(buf, "%u\n", data->in_status[offset+7]); \ 457 return sprintf(buf, "%u\n", data->in_status[offset+7]); \
458} \ 458} \
459static ssize_t set_temp##offset##_min(struct device *dev, const char *buf, \ 459static ssize_t set_temp##offset##_min(struct device *dev, struct device_attribute *attr, const char *buf, \
460 size_t count) \ 460 size_t count) \
461{ \ 461{ \
462 struct i2c_client *client = to_i2c_client(dev); \ 462 struct i2c_client *client = to_i2c_client(dev); \
@@ -470,7 +470,7 @@ static ssize_t set_temp##offset##_min(struct device *dev, const char *buf, \
470 up(&data->update_lock); \ 470 up(&data->update_lock); \
471 return count; \ 471 return count; \
472} \ 472} \
473static ssize_t set_temp##offset##_max(struct device *dev, const char *buf, \ 473static ssize_t set_temp##offset##_max(struct device *dev, struct device_attribute *attr, const char *buf, \
474 size_t count) \ 474 size_t count) \
475{ \ 475{ \
476 struct i2c_client *client = to_i2c_client(dev); \ 476 struct i2c_client *client = to_i2c_client(dev); \
@@ -484,7 +484,7 @@ static ssize_t set_temp##offset##_max(struct device *dev, const char *buf, \
484 up(&data->update_lock); \ 484 up(&data->update_lock); \
485 return count; \ 485 return count; \
486} \ 486} \
487static ssize_t set_temp##offset##_crit(struct device *dev, const char *buf, \ 487static ssize_t set_temp##offset##_crit(struct device *dev, struct device_attribute *attr, const char *buf, \
488 size_t count) \ 488 size_t count) \
489{ \ 489{ \
490 struct i2c_client *client = to_i2c_client(dev); \ 490 struct i2c_client *client = to_i2c_client(dev); \
@@ -512,19 +512,19 @@ show_and_set_therm(4)
512show_and_set_therm(5) 512show_and_set_therm(5)
513show_and_set_therm(6) 513show_and_set_therm(6)
514 514
515static ssize_t show_vid(struct device *dev, char *buf) 515static ssize_t show_vid(struct device *dev, struct device_attribute *attr, char *buf)
516{ 516{
517 struct pc87360_data *data = pc87360_update_device(dev); 517 struct pc87360_data *data = pc87360_update_device(dev);
518 return sprintf(buf, "%u\n", vid_from_reg(data->vid, data->vrm)); 518 return sprintf(buf, "%u\n", vid_from_reg(data->vid, data->vrm));
519} 519}
520static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid, NULL); 520static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid, NULL);
521 521
522static ssize_t show_vrm(struct device *dev, char *buf) 522static ssize_t show_vrm(struct device *dev, struct device_attribute *attr, char *buf)
523{ 523{
524 struct pc87360_data *data = pc87360_update_device(dev); 524 struct pc87360_data *data = pc87360_update_device(dev);
525 return sprintf(buf, "%u\n", data->vrm); 525 return sprintf(buf, "%u\n", data->vrm);
526} 526}
527static ssize_t set_vrm(struct device *dev, const char *buf, size_t count) 527static ssize_t set_vrm(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
528{ 528{
529 struct i2c_client *client = to_i2c_client(dev); 529 struct i2c_client *client = to_i2c_client(dev);
530 struct pc87360_data *data = i2c_get_clientdata(client); 530 struct pc87360_data *data = i2c_get_clientdata(client);
@@ -533,7 +533,7 @@ static ssize_t set_vrm(struct device *dev, const char *buf, size_t count)
533} 533}
534static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm, set_vrm); 534static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm, set_vrm);
535 535
536static ssize_t show_in_alarms(struct device *dev, char *buf) 536static ssize_t show_in_alarms(struct device *dev, struct device_attribute *attr, char *buf)
537{ 537{
538 struct pc87360_data *data = pc87360_update_device(dev); 538 struct pc87360_data *data = pc87360_update_device(dev);
539 return sprintf(buf, "%u\n", data->in_alarms); 539 return sprintf(buf, "%u\n", data->in_alarms);
@@ -541,32 +541,32 @@ static ssize_t show_in_alarms(struct device *dev, char *buf)
541static DEVICE_ATTR(alarms_in, S_IRUGO, show_in_alarms, NULL); 541static DEVICE_ATTR(alarms_in, S_IRUGO, show_in_alarms, NULL);
542 542
543#define show_and_set_temp(offset) \ 543#define show_and_set_temp(offset) \
544static ssize_t show_temp##offset##_input(struct device *dev, char *buf) \ 544static ssize_t show_temp##offset##_input(struct device *dev, struct device_attribute *attr, char *buf) \
545{ \ 545{ \
546 struct pc87360_data *data = pc87360_update_device(dev); \ 546 struct pc87360_data *data = pc87360_update_device(dev); \
547 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp[offset-1])); \ 547 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp[offset-1])); \
548} \ 548} \
549static ssize_t show_temp##offset##_min(struct device *dev, char *buf) \ 549static ssize_t show_temp##offset##_min(struct device *dev, struct device_attribute *attr, char *buf) \
550{ \ 550{ \
551 struct pc87360_data *data = pc87360_update_device(dev); \ 551 struct pc87360_data *data = pc87360_update_device(dev); \
552 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_min[offset-1])); \ 552 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_min[offset-1])); \
553} \ 553} \
554static ssize_t show_temp##offset##_max(struct device *dev, char *buf) \ 554static ssize_t show_temp##offset##_max(struct device *dev, struct device_attribute *attr, char *buf) \
555{ \ 555{ \
556 struct pc87360_data *data = pc87360_update_device(dev); \ 556 struct pc87360_data *data = pc87360_update_device(dev); \
557 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_max[offset-1])); \ 557 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_max[offset-1])); \
558}\ 558}\
559static ssize_t show_temp##offset##_crit(struct device *dev, char *buf) \ 559static ssize_t show_temp##offset##_crit(struct device *dev, struct device_attribute *attr, char *buf) \
560{ \ 560{ \
561 struct pc87360_data *data = pc87360_update_device(dev); \ 561 struct pc87360_data *data = pc87360_update_device(dev); \
562 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_crit[offset-1])); \ 562 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_crit[offset-1])); \
563}\ 563}\
564static ssize_t show_temp##offset##_status(struct device *dev, char *buf) \ 564static ssize_t show_temp##offset##_status(struct device *dev, struct device_attribute *attr, char *buf) \
565{ \ 565{ \
566 struct pc87360_data *data = pc87360_update_device(dev); \ 566 struct pc87360_data *data = pc87360_update_device(dev); \
567 return sprintf(buf, "%d\n", data->temp_status[offset-1]); \ 567 return sprintf(buf, "%d\n", data->temp_status[offset-1]); \
568}\ 568}\
569static ssize_t set_temp##offset##_min(struct device *dev, const char *buf, \ 569static ssize_t set_temp##offset##_min(struct device *dev, struct device_attribute *attr, const char *buf, \
570 size_t count) \ 570 size_t count) \
571{ \ 571{ \
572 struct i2c_client *client = to_i2c_client(dev); \ 572 struct i2c_client *client = to_i2c_client(dev); \
@@ -580,7 +580,7 @@ static ssize_t set_temp##offset##_min(struct device *dev, const char *buf, \
580 up(&data->update_lock); \ 580 up(&data->update_lock); \
581 return count; \ 581 return count; \
582} \ 582} \
583static ssize_t set_temp##offset##_max(struct device *dev, const char *buf, \ 583static ssize_t set_temp##offset##_max(struct device *dev, struct device_attribute *attr, const char *buf, \
584 size_t count) \ 584 size_t count) \
585{ \ 585{ \
586 struct i2c_client *client = to_i2c_client(dev); \ 586 struct i2c_client *client = to_i2c_client(dev); \
@@ -594,7 +594,7 @@ static ssize_t set_temp##offset##_max(struct device *dev, const char *buf, \
594 up(&data->update_lock); \ 594 up(&data->update_lock); \
595 return count; \ 595 return count; \
596} \ 596} \
597static ssize_t set_temp##offset##_crit(struct device *dev, const char *buf, \ 597static ssize_t set_temp##offset##_crit(struct device *dev, struct device_attribute *attr, const char *buf, \
598 size_t count) \ 598 size_t count) \
599{ \ 599{ \
600 struct i2c_client *client = to_i2c_client(dev); \ 600 struct i2c_client *client = to_i2c_client(dev); \
@@ -622,7 +622,7 @@ show_and_set_temp(1)
622show_and_set_temp(2) 622show_and_set_temp(2)
623show_and_set_temp(3) 623show_and_set_temp(3)
624 624
625static ssize_t show_temp_alarms(struct device *dev, char *buf) 625static ssize_t show_temp_alarms(struct device *dev, struct device_attribute *attr, char *buf)
626{ 626{
627 struct pc87360_data *data = pc87360_update_device(dev); 627 struct pc87360_data *data = pc87360_update_device(dev);
628 return sprintf(buf, "%u\n", data->temp_alarms); 628 return sprintf(buf, "%u\n", data->temp_alarms);
diff --git a/drivers/i2c/chips/pcf8574.c b/drivers/i2c/chips/pcf8574.c
index 48b4e22eaffe..4956e9effd75 100644
--- a/drivers/i2c/chips/pcf8574.c
+++ b/drivers/i2c/chips/pcf8574.c
@@ -76,7 +76,7 @@ static struct i2c_driver pcf8574_driver = {
76}; 76};
77 77
78/* following are the sysfs callback functions */ 78/* following are the sysfs callback functions */
79static ssize_t show_read(struct device *dev, char *buf) 79static ssize_t show_read(struct device *dev, struct device_attribute *attr, char *buf)
80{ 80{
81 struct i2c_client *client = to_i2c_client(dev); 81 struct i2c_client *client = to_i2c_client(dev);
82 struct pcf8574_data *data = i2c_get_clientdata(client); 82 struct pcf8574_data *data = i2c_get_clientdata(client);
@@ -86,13 +86,13 @@ static ssize_t show_read(struct device *dev, char *buf)
86 86
87static DEVICE_ATTR(read, S_IRUGO, show_read, NULL); 87static DEVICE_ATTR(read, S_IRUGO, show_read, NULL);
88 88
89static ssize_t show_write(struct device *dev, char *buf) 89static ssize_t show_write(struct device *dev, struct device_attribute *attr, char *buf)
90{ 90{
91 struct pcf8574_data *data = i2c_get_clientdata(to_i2c_client(dev)); 91 struct pcf8574_data *data = i2c_get_clientdata(to_i2c_client(dev));
92 return sprintf(buf, "%u\n", data->write); 92 return sprintf(buf, "%u\n", data->write);
93} 93}
94 94
95static ssize_t set_write(struct device *dev, const char *buf, 95static ssize_t set_write(struct device *dev, struct device_attribute *attr, const char *buf,
96 size_t count) 96 size_t count)
97{ 97{
98 struct i2c_client *client = to_i2c_client(dev); 98 struct i2c_client *client = to_i2c_client(dev);
diff --git a/drivers/i2c/chips/pcf8591.c b/drivers/i2c/chips/pcf8591.c
index b6b927d8b372..db812ade8564 100644
--- a/drivers/i2c/chips/pcf8591.c
+++ b/drivers/i2c/chips/pcf8591.c
@@ -100,7 +100,7 @@ static struct i2c_driver pcf8591_driver = {
100 100
101/* following are the sysfs callback functions */ 101/* following are the sysfs callback functions */
102#define show_in_channel(channel) \ 102#define show_in_channel(channel) \
103static ssize_t show_in##channel##_input(struct device *dev, char *buf) \ 103static ssize_t show_in##channel##_input(struct device *dev, struct device_attribute *attr, char *buf) \
104{ \ 104{ \
105 return sprintf(buf, "%d\n", pcf8591_read_channel(dev, channel));\ 105 return sprintf(buf, "%d\n", pcf8591_read_channel(dev, channel));\
106} \ 106} \
@@ -112,13 +112,13 @@ show_in_channel(1);
112show_in_channel(2); 112show_in_channel(2);
113show_in_channel(3); 113show_in_channel(3);
114 114
115static ssize_t show_out0_ouput(struct device *dev, char *buf) 115static ssize_t show_out0_ouput(struct device *dev, struct device_attribute *attr, char *buf)
116{ 116{
117 struct pcf8591_data *data = i2c_get_clientdata(to_i2c_client(dev)); 117 struct pcf8591_data *data = i2c_get_clientdata(to_i2c_client(dev));
118 return sprintf(buf, "%d\n", data->aout * 10); 118 return sprintf(buf, "%d\n", data->aout * 10);
119} 119}
120 120
121static ssize_t set_out0_output(struct device *dev, const char *buf, size_t count) 121static ssize_t set_out0_output(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
122{ 122{
123 unsigned int value; 123 unsigned int value;
124 struct i2c_client *client = to_i2c_client(dev); 124 struct i2c_client *client = to_i2c_client(dev);
@@ -134,13 +134,13 @@ static ssize_t set_out0_output(struct device *dev, const char *buf, size_t count
134static DEVICE_ATTR(out0_output, S_IWUSR | S_IRUGO, 134static DEVICE_ATTR(out0_output, S_IWUSR | S_IRUGO,
135 show_out0_ouput, set_out0_output); 135 show_out0_ouput, set_out0_output);
136 136
137static ssize_t show_out0_enable(struct device *dev, char *buf) 137static ssize_t show_out0_enable(struct device *dev, struct device_attribute *attr, char *buf)
138{ 138{
139 struct pcf8591_data *data = i2c_get_clientdata(to_i2c_client(dev)); 139 struct pcf8591_data *data = i2c_get_clientdata(to_i2c_client(dev));
140 return sprintf(buf, "%u\n", !(!(data->control & PCF8591_CONTROL_AOEF))); 140 return sprintf(buf, "%u\n", !(!(data->control & PCF8591_CONTROL_AOEF)));
141} 141}
142 142
143static ssize_t set_out0_enable(struct device *dev, const char *buf, size_t count) 143static ssize_t set_out0_enable(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
144{ 144{
145 struct i2c_client *client = to_i2c_client(dev); 145 struct i2c_client *client = to_i2c_client(dev);
146 struct pcf8591_data *data = i2c_get_clientdata(client); 146 struct pcf8591_data *data = i2c_get_clientdata(client);
diff --git a/drivers/i2c/chips/sis5595.c b/drivers/i2c/chips/sis5595.c
index 7ea84532df32..c6650727a27d 100644
--- a/drivers/i2c/chips/sis5595.c
+++ b/drivers/i2c/chips/sis5595.c
@@ -256,28 +256,28 @@ static ssize_t set_in_max(struct device *dev, const char *buf,
256 256
257#define show_in_offset(offset) \ 257#define show_in_offset(offset) \
258static ssize_t \ 258static ssize_t \
259 show_in##offset (struct device *dev, char *buf) \ 259 show_in##offset (struct device *dev, struct device_attribute *attr, char *buf) \
260{ \ 260{ \
261 return show_in(dev, buf, offset); \ 261 return show_in(dev, buf, offset); \
262} \ 262} \
263static DEVICE_ATTR(in##offset##_input, S_IRUGO, \ 263static DEVICE_ATTR(in##offset##_input, S_IRUGO, \
264 show_in##offset, NULL); \ 264 show_in##offset, NULL); \
265static ssize_t \ 265static ssize_t \
266 show_in##offset##_min (struct device *dev, char *buf) \ 266 show_in##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \
267{ \ 267{ \
268 return show_in_min(dev, buf, offset); \ 268 return show_in_min(dev, buf, offset); \
269} \ 269} \
270static ssize_t \ 270static ssize_t \
271 show_in##offset##_max (struct device *dev, char *buf) \ 271 show_in##offset##_max (struct device *dev, struct device_attribute *attr, char *buf) \
272{ \ 272{ \
273 return show_in_max(dev, buf, offset); \ 273 return show_in_max(dev, buf, offset); \
274} \ 274} \
275static ssize_t set_in##offset##_min (struct device *dev, \ 275static ssize_t set_in##offset##_min (struct device *dev, struct device_attribute *attr, \
276 const char *buf, size_t count) \ 276 const char *buf, size_t count) \
277{ \ 277{ \
278 return set_in_min(dev, buf, count, offset); \ 278 return set_in_min(dev, buf, count, offset); \
279} \ 279} \
280static ssize_t set_in##offset##_max (struct device *dev, \ 280static ssize_t set_in##offset##_max (struct device *dev, struct device_attribute *attr, \
281 const char *buf, size_t count) \ 281 const char *buf, size_t count) \
282{ \ 282{ \
283 return set_in_max(dev, buf, count, offset); \ 283 return set_in_max(dev, buf, count, offset); \
@@ -294,19 +294,19 @@ show_in_offset(3);
294show_in_offset(4); 294show_in_offset(4);
295 295
296/* Temperature */ 296/* Temperature */
297static ssize_t show_temp(struct device *dev, char *buf) 297static ssize_t show_temp(struct device *dev, struct device_attribute *attr, char *buf)
298{ 298{
299 struct sis5595_data *data = sis5595_update_device(dev); 299 struct sis5595_data *data = sis5595_update_device(dev);
300 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp)); 300 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp));
301} 301}
302 302
303static ssize_t show_temp_over(struct device *dev, char *buf) 303static ssize_t show_temp_over(struct device *dev, struct device_attribute *attr, char *buf)
304{ 304{
305 struct sis5595_data *data = sis5595_update_device(dev); 305 struct sis5595_data *data = sis5595_update_device(dev);
306 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_over)); 306 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_over));
307} 307}
308 308
309static ssize_t set_temp_over(struct device *dev, const char *buf, size_t count) 309static ssize_t set_temp_over(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
310{ 310{
311 struct i2c_client *client = to_i2c_client(dev); 311 struct i2c_client *client = to_i2c_client(dev);
312 struct sis5595_data *data = i2c_get_clientdata(client); 312 struct sis5595_data *data = i2c_get_clientdata(client);
@@ -319,13 +319,13 @@ static ssize_t set_temp_over(struct device *dev, const char *buf, size_t count)
319 return count; 319 return count;
320} 320}
321 321
322static ssize_t show_temp_hyst(struct device *dev, char *buf) 322static ssize_t show_temp_hyst(struct device *dev, struct device_attribute *attr, char *buf)
323{ 323{
324 struct sis5595_data *data = sis5595_update_device(dev); 324 struct sis5595_data *data = sis5595_update_device(dev);
325 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_hyst)); 325 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_hyst));
326} 326}
327 327
328static ssize_t set_temp_hyst(struct device *dev, const char *buf, size_t count) 328static ssize_t set_temp_hyst(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
329{ 329{
330 struct i2c_client *client = to_i2c_client(dev); 330 struct i2c_client *client = to_i2c_client(dev);
331 struct sis5595_data *data = i2c_get_clientdata(client); 331 struct sis5595_data *data = i2c_get_clientdata(client);
@@ -426,19 +426,19 @@ static ssize_t set_fan_div(struct device *dev, const char *buf,
426} 426}
427 427
428#define show_fan_offset(offset) \ 428#define show_fan_offset(offset) \
429static ssize_t show_fan_##offset (struct device *dev, char *buf) \ 429static ssize_t show_fan_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
430{ \ 430{ \
431 return show_fan(dev, buf, offset - 1); \ 431 return show_fan(dev, buf, offset - 1); \
432} \ 432} \
433static ssize_t show_fan_##offset##_min (struct device *dev, char *buf) \ 433static ssize_t show_fan_##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \
434{ \ 434{ \
435 return show_fan_min(dev, buf, offset - 1); \ 435 return show_fan_min(dev, buf, offset - 1); \
436} \ 436} \
437static ssize_t show_fan_##offset##_div (struct device *dev, char *buf) \ 437static ssize_t show_fan_##offset##_div (struct device *dev, struct device_attribute *attr, char *buf) \
438{ \ 438{ \
439 return show_fan_div(dev, buf, offset - 1); \ 439 return show_fan_div(dev, buf, offset - 1); \
440} \ 440} \
441static ssize_t set_fan_##offset##_min (struct device *dev, \ 441static ssize_t set_fan_##offset##_min (struct device *dev, struct device_attribute *attr, \
442 const char *buf, size_t count) \ 442 const char *buf, size_t count) \
443{ \ 443{ \
444 return set_fan_min(dev, buf, count, offset - 1); \ 444 return set_fan_min(dev, buf, count, offset - 1); \
@@ -450,13 +450,13 @@ static DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR, \
450show_fan_offset(1); 450show_fan_offset(1);
451show_fan_offset(2); 451show_fan_offset(2);
452 452
453static ssize_t set_fan_1_div(struct device *dev, const char *buf, 453static ssize_t set_fan_1_div(struct device *dev, struct device_attribute *attr, const char *buf,
454 size_t count) 454 size_t count)
455{ 455{
456 return set_fan_div(dev, buf, count, 0) ; 456 return set_fan_div(dev, buf, count, 0) ;
457} 457}
458 458
459static ssize_t set_fan_2_div(struct device *dev, const char *buf, 459static ssize_t set_fan_2_div(struct device *dev, struct device_attribute *attr, const char *buf,
460 size_t count) 460 size_t count)
461{ 461{
462 return set_fan_div(dev, buf, count, 1) ; 462 return set_fan_div(dev, buf, count, 1) ;
@@ -467,7 +467,7 @@ static DEVICE_ATTR(fan2_div, S_IRUGO | S_IWUSR,
467 show_fan_2_div, set_fan_2_div); 467 show_fan_2_div, set_fan_2_div);
468 468
469/* Alarms */ 469/* Alarms */
470static ssize_t show_alarms(struct device *dev, char *buf) 470static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf)
471{ 471{
472 struct sis5595_data *data = sis5595_update_device(dev); 472 struct sis5595_data *data = sis5595_update_device(dev);
473 return sprintf(buf, "%d\n", data->alarms); 473 return sprintf(buf, "%d\n", data->alarms);
diff --git a/drivers/i2c/chips/smsc47b397.c b/drivers/i2c/chips/smsc47b397.c
index 1119c76791d9..251ac2659554 100644
--- a/drivers/i2c/chips/smsc47b397.c
+++ b/drivers/i2c/chips/smsc47b397.c
@@ -172,7 +172,7 @@ static ssize_t show_temp(struct device *dev, char *buf, int nr)
172} 172}
173 173
174#define sysfs_temp(num) \ 174#define sysfs_temp(num) \
175static ssize_t show_temp##num(struct device *dev, char *buf) \ 175static ssize_t show_temp##num(struct device *dev, struct device_attribute *attr, char *buf) \
176{ \ 176{ \
177 return show_temp(dev, buf, num-1); \ 177 return show_temp(dev, buf, num-1); \
178} \ 178} \
@@ -201,7 +201,7 @@ static ssize_t show_fan(struct device *dev, char *buf, int nr)
201} 201}
202 202
203#define sysfs_fan(num) \ 203#define sysfs_fan(num) \
204static ssize_t show_fan##num(struct device *dev, char *buf) \ 204static ssize_t show_fan##num(struct device *dev, struct device_attribute *attr, char *buf) \
205{ \ 205{ \
206 return show_fan(dev, buf, num-1); \ 206 return show_fan(dev, buf, num-1); \
207} \ 207} \
diff --git a/drivers/i2c/chips/smsc47m1.c b/drivers/i2c/chips/smsc47m1.c
index 0e12ca369413..13d6d4a8bc7d 100644
--- a/drivers/i2c/chips/smsc47m1.c
+++ b/drivers/i2c/chips/smsc47m1.c
@@ -184,7 +184,7 @@ static ssize_t get_pwm_en(struct device *dev, char *buf, int nr)
184 return sprintf(buf, "%d\n", PWM_EN_FROM_REG(data->pwm[nr])); 184 return sprintf(buf, "%d\n", PWM_EN_FROM_REG(data->pwm[nr]));
185} 185}
186 186
187static ssize_t get_alarms(struct device *dev, char *buf) 187static ssize_t get_alarms(struct device *dev, struct device_attribute *attr, char *buf)
188{ 188{
189 struct smsc47m1_data *data = smsc47m1_update_device(dev, 0); 189 struct smsc47m1_data *data = smsc47m1_update_device(dev, 0);
190 return sprintf(buf, "%d\n", data->alarms); 190 return sprintf(buf, "%d\n", data->alarms);
@@ -298,42 +298,42 @@ static ssize_t set_pwm_en(struct device *dev, const char *buf,
298} 298}
299 299
300#define fan_present(offset) \ 300#define fan_present(offset) \
301static ssize_t get_fan##offset (struct device *dev, char *buf) \ 301static ssize_t get_fan##offset (struct device *dev, struct device_attribute *attr, char *buf) \
302{ \ 302{ \
303 return get_fan(dev, buf, offset - 1); \ 303 return get_fan(dev, buf, offset - 1); \
304} \ 304} \
305static ssize_t get_fan##offset##_min (struct device *dev, char *buf) \ 305static ssize_t get_fan##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \
306{ \ 306{ \
307 return get_fan_min(dev, buf, offset - 1); \ 307 return get_fan_min(dev, buf, offset - 1); \
308} \ 308} \
309static ssize_t set_fan##offset##_min (struct device *dev, \ 309static ssize_t set_fan##offset##_min (struct device *dev, struct device_attribute *attr, \
310 const char *buf, size_t count) \ 310 const char *buf, size_t count) \
311{ \ 311{ \
312 return set_fan_min(dev, buf, count, offset - 1); \ 312 return set_fan_min(dev, buf, count, offset - 1); \
313} \ 313} \
314static ssize_t get_fan##offset##_div (struct device *dev, char *buf) \ 314static ssize_t get_fan##offset##_div (struct device *dev, struct device_attribute *attr, char *buf) \
315{ \ 315{ \
316 return get_fan_div(dev, buf, offset - 1); \ 316 return get_fan_div(dev, buf, offset - 1); \
317} \ 317} \
318static ssize_t set_fan##offset##_div (struct device *dev, \ 318static ssize_t set_fan##offset##_div (struct device *dev, struct device_attribute *attr, \
319 const char *buf, size_t count) \ 319 const char *buf, size_t count) \
320{ \ 320{ \
321 return set_fan_div(dev, buf, count, offset - 1); \ 321 return set_fan_div(dev, buf, count, offset - 1); \
322} \ 322} \
323static ssize_t get_pwm##offset (struct device *dev, char *buf) \ 323static ssize_t get_pwm##offset (struct device *dev, struct device_attribute *attr, char *buf) \
324{ \ 324{ \
325 return get_pwm(dev, buf, offset - 1); \ 325 return get_pwm(dev, buf, offset - 1); \
326} \ 326} \
327static ssize_t set_pwm##offset (struct device *dev, \ 327static ssize_t set_pwm##offset (struct device *dev, struct device_attribute *attr, \
328 const char *buf, size_t count) \ 328 const char *buf, size_t count) \
329{ \ 329{ \
330 return set_pwm(dev, buf, count, offset - 1); \ 330 return set_pwm(dev, buf, count, offset - 1); \
331} \ 331} \
332static ssize_t get_pwm##offset##_en (struct device *dev, char *buf) \ 332static ssize_t get_pwm##offset##_en (struct device *dev, struct device_attribute *attr, char *buf) \
333{ \ 333{ \
334 return get_pwm_en(dev, buf, offset - 1); \ 334 return get_pwm_en(dev, buf, offset - 1); \
335} \ 335} \
336static ssize_t set_pwm##offset##_en (struct device *dev, \ 336static ssize_t set_pwm##offset##_en (struct device *dev, struct device_attribute *attr, \
337 const char *buf, size_t count) \ 337 const char *buf, size_t count) \
338{ \ 338{ \
339 return set_pwm_en(dev, buf, count, offset - 1); \ 339 return set_pwm_en(dev, buf, count, offset - 1); \
diff --git a/drivers/i2c/chips/via686a.c b/drivers/i2c/chips/via686a.c
index 6614a59cecd4..fefc24a9251a 100644
--- a/drivers/i2c/chips/via686a.c
+++ b/drivers/i2c/chips/via686a.c
@@ -386,26 +386,26 @@ static ssize_t set_in_max(struct device *dev, const char *buf,
386} 386}
387#define show_in_offset(offset) \ 387#define show_in_offset(offset) \
388static ssize_t \ 388static ssize_t \
389 show_in##offset (struct device *dev, char *buf) \ 389 show_in##offset (struct device *dev, struct device_attribute *attr, char *buf) \
390{ \ 390{ \
391 return show_in(dev, buf, offset); \ 391 return show_in(dev, buf, offset); \
392} \ 392} \
393static ssize_t \ 393static ssize_t \
394 show_in##offset##_min (struct device *dev, char *buf) \ 394 show_in##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \
395{ \ 395{ \
396 return show_in_min(dev, buf, offset); \ 396 return show_in_min(dev, buf, offset); \
397} \ 397} \
398static ssize_t \ 398static ssize_t \
399 show_in##offset##_max (struct device *dev, char *buf) \ 399 show_in##offset##_max (struct device *dev, struct device_attribute *attr, char *buf) \
400{ \ 400{ \
401 return show_in_max(dev, buf, offset); \ 401 return show_in_max(dev, buf, offset); \
402} \ 402} \
403static ssize_t set_in##offset##_min (struct device *dev, \ 403static ssize_t set_in##offset##_min (struct device *dev, struct device_attribute *attr, \
404 const char *buf, size_t count) \ 404 const char *buf, size_t count) \
405{ \ 405{ \
406 return set_in_min(dev, buf, count, offset); \ 406 return set_in_min(dev, buf, count, offset); \
407} \ 407} \
408static ssize_t set_in##offset##_max (struct device *dev, \ 408static ssize_t set_in##offset##_max (struct device *dev, struct device_attribute *attr, \
409 const char *buf, size_t count) \ 409 const char *buf, size_t count) \
410{ \ 410{ \
411 return set_in_max(dev, buf, count, offset); \ 411 return set_in_max(dev, buf, count, offset); \
@@ -460,26 +460,26 @@ static ssize_t set_temp_hyst(struct device *dev, const char *buf,
460 return count; 460 return count;
461} 461}
462#define show_temp_offset(offset) \ 462#define show_temp_offset(offset) \
463static ssize_t show_temp_##offset (struct device *dev, char *buf) \ 463static ssize_t show_temp_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
464{ \ 464{ \
465 return show_temp(dev, buf, offset - 1); \ 465 return show_temp(dev, buf, offset - 1); \
466} \ 466} \
467static ssize_t \ 467static ssize_t \
468show_temp_##offset##_over (struct device *dev, char *buf) \ 468show_temp_##offset##_over (struct device *dev, struct device_attribute *attr, char *buf) \
469{ \ 469{ \
470 return show_temp_over(dev, buf, offset - 1); \ 470 return show_temp_over(dev, buf, offset - 1); \
471} \ 471} \
472static ssize_t \ 472static ssize_t \
473show_temp_##offset##_hyst (struct device *dev, char *buf) \ 473show_temp_##offset##_hyst (struct device *dev, struct device_attribute *attr, char *buf) \
474{ \ 474{ \
475 return show_temp_hyst(dev, buf, offset - 1); \ 475 return show_temp_hyst(dev, buf, offset - 1); \
476} \ 476} \
477static ssize_t set_temp_##offset##_over (struct device *dev, \ 477static ssize_t set_temp_##offset##_over (struct device *dev, struct device_attribute *attr, \
478 const char *buf, size_t count) \ 478 const char *buf, size_t count) \
479{ \ 479{ \
480 return set_temp_over(dev, buf, count, offset - 1); \ 480 return set_temp_over(dev, buf, count, offset - 1); \
481} \ 481} \
482static ssize_t set_temp_##offset##_hyst (struct device *dev, \ 482static ssize_t set_temp_##offset##_hyst (struct device *dev, struct device_attribute *attr, \
483 const char *buf, size_t count) \ 483 const char *buf, size_t count) \
484{ \ 484{ \
485 return set_temp_hyst(dev, buf, count, offset - 1); \ 485 return set_temp_hyst(dev, buf, count, offset - 1); \
@@ -538,24 +538,24 @@ static ssize_t set_fan_div(struct device *dev, const char *buf,
538} 538}
539 539
540#define show_fan_offset(offset) \ 540#define show_fan_offset(offset) \
541static ssize_t show_fan_##offset (struct device *dev, char *buf) \ 541static ssize_t show_fan_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
542{ \ 542{ \
543 return show_fan(dev, buf, offset - 1); \ 543 return show_fan(dev, buf, offset - 1); \
544} \ 544} \
545static ssize_t show_fan_##offset##_min (struct device *dev, char *buf) \ 545static ssize_t show_fan_##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \
546{ \ 546{ \
547 return show_fan_min(dev, buf, offset - 1); \ 547 return show_fan_min(dev, buf, offset - 1); \
548} \ 548} \
549static ssize_t show_fan_##offset##_div (struct device *dev, char *buf) \ 549static ssize_t show_fan_##offset##_div (struct device *dev, struct device_attribute *attr, char *buf) \
550{ \ 550{ \
551 return show_fan_div(dev, buf, offset - 1); \ 551 return show_fan_div(dev, buf, offset - 1); \
552} \ 552} \
553static ssize_t set_fan_##offset##_min (struct device *dev, \ 553static ssize_t set_fan_##offset##_min (struct device *dev, struct device_attribute *attr, \
554 const char *buf, size_t count) \ 554 const char *buf, size_t count) \
555{ \ 555{ \
556 return set_fan_min(dev, buf, count, offset - 1); \ 556 return set_fan_min(dev, buf, count, offset - 1); \
557} \ 557} \
558static ssize_t set_fan_##offset##_div (struct device *dev, \ 558static ssize_t set_fan_##offset##_div (struct device *dev, struct device_attribute *attr, \
559 const char *buf, size_t count) \ 559 const char *buf, size_t count) \
560{ \ 560{ \
561 return set_fan_div(dev, buf, count, offset - 1); \ 561 return set_fan_div(dev, buf, count, offset - 1); \
@@ -570,7 +570,7 @@ show_fan_offset(1);
570show_fan_offset(2); 570show_fan_offset(2);
571 571
572/* Alarms */ 572/* Alarms */
573static ssize_t show_alarms(struct device *dev, char *buf) { 573static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf) {
574 struct via686a_data *data = via686a_update_device(dev); 574 struct via686a_data *data = via686a_update_device(dev);
575 return sprintf(buf,"%d\n", ALARMS_FROM_REG(data->alarms)); 575 return sprintf(buf,"%d\n", ALARMS_FROM_REG(data->alarms));
576} 576}
diff --git a/drivers/i2c/chips/w83627hf.c b/drivers/i2c/chips/w83627hf.c
index b1da5ed696d3..4f1bff572c1c 100644
--- a/drivers/i2c/chips/w83627hf.c
+++ b/drivers/i2c/chips/w83627hf.c
@@ -368,19 +368,19 @@ store_in_reg(MAX, max)
368 368
369#define sysfs_in_offset(offset) \ 369#define sysfs_in_offset(offset) \
370static ssize_t \ 370static ssize_t \
371show_regs_in_##offset (struct device *dev, char *buf) \ 371show_regs_in_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
372{ \ 372{ \
373 return show_in(dev, buf, offset); \ 373 return show_in(dev, buf, offset); \
374} \ 374} \
375static DEVICE_ATTR(in##offset##_input, S_IRUGO, show_regs_in_##offset, NULL); 375static DEVICE_ATTR(in##offset##_input, S_IRUGO, show_regs_in_##offset, NULL);
376 376
377#define sysfs_in_reg_offset(reg, offset) \ 377#define sysfs_in_reg_offset(reg, offset) \
378static ssize_t show_regs_in_##reg##offset (struct device *dev, char *buf) \ 378static ssize_t show_regs_in_##reg##offset (struct device *dev, struct device_attribute *attr, char *buf) \
379{ \ 379{ \
380 return show_in_##reg (dev, buf, offset); \ 380 return show_in_##reg (dev, buf, offset); \
381} \ 381} \
382static ssize_t \ 382static ssize_t \
383store_regs_in_##reg##offset (struct device *dev, \ 383store_regs_in_##reg##offset (struct device *dev, struct device_attribute *attr, \
384 const char *buf, size_t count) \ 384 const char *buf, size_t count) \
385{ \ 385{ \
386 return store_in_##reg (dev, buf, count, offset); \ 386 return store_in_##reg (dev, buf, count, offset); \
@@ -419,25 +419,25 @@ static ssize_t show_in_0(struct w83627hf_data *data, char *buf, u8 reg)
419 return sprintf(buf,"%ld\n", in0); 419 return sprintf(buf,"%ld\n", in0);
420} 420}
421 421
422static ssize_t show_regs_in_0(struct device *dev, char *buf) 422static ssize_t show_regs_in_0(struct device *dev, struct device_attribute *attr, char *buf)
423{ 423{
424 struct w83627hf_data *data = w83627hf_update_device(dev); 424 struct w83627hf_data *data = w83627hf_update_device(dev);
425 return show_in_0(data, buf, data->in[0]); 425 return show_in_0(data, buf, data->in[0]);
426} 426}
427 427
428static ssize_t show_regs_in_min0(struct device *dev, char *buf) 428static ssize_t show_regs_in_min0(struct device *dev, struct device_attribute *attr, char *buf)
429{ 429{
430 struct w83627hf_data *data = w83627hf_update_device(dev); 430 struct w83627hf_data *data = w83627hf_update_device(dev);
431 return show_in_0(data, buf, data->in_min[0]); 431 return show_in_0(data, buf, data->in_min[0]);
432} 432}
433 433
434static ssize_t show_regs_in_max0(struct device *dev, char *buf) 434static ssize_t show_regs_in_max0(struct device *dev, struct device_attribute *attr, char *buf)
435{ 435{
436 struct w83627hf_data *data = w83627hf_update_device(dev); 436 struct w83627hf_data *data = w83627hf_update_device(dev);
437 return show_in_0(data, buf, data->in_max[0]); 437 return show_in_0(data, buf, data->in_max[0]);
438} 438}
439 439
440static ssize_t store_regs_in_min0(struct device *dev, 440static ssize_t store_regs_in_min0(struct device *dev, struct device_attribute *attr,
441 const char *buf, size_t count) 441 const char *buf, size_t count)
442{ 442{
443 struct i2c_client *client = to_i2c_client(dev); 443 struct i2c_client *client = to_i2c_client(dev);
@@ -462,7 +462,7 @@ static ssize_t store_regs_in_min0(struct device *dev,
462 return count; 462 return count;
463} 463}
464 464
465static ssize_t store_regs_in_max0(struct device *dev, 465static ssize_t store_regs_in_max0(struct device *dev, struct device_attribute *attr,
466 const char *buf, size_t count) 466 const char *buf, size_t count)
467{ 467{
468 struct i2c_client *client = to_i2c_client(dev); 468 struct i2c_client *client = to_i2c_client(dev);
@@ -531,19 +531,19 @@ store_fan_min(struct device *dev, const char *buf, size_t count, int nr)
531} 531}
532 532
533#define sysfs_fan_offset(offset) \ 533#define sysfs_fan_offset(offset) \
534static ssize_t show_regs_fan_##offset (struct device *dev, char *buf) \ 534static ssize_t show_regs_fan_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
535{ \ 535{ \
536 return show_fan(dev, buf, offset); \ 536 return show_fan(dev, buf, offset); \
537} \ 537} \
538static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_regs_fan_##offset, NULL); 538static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_regs_fan_##offset, NULL);
539 539
540#define sysfs_fan_min_offset(offset) \ 540#define sysfs_fan_min_offset(offset) \
541static ssize_t show_regs_fan_min##offset (struct device *dev, char *buf) \ 541static ssize_t show_regs_fan_min##offset (struct device *dev, struct device_attribute *attr, char *buf) \
542{ \ 542{ \
543 return show_fan_min(dev, buf, offset); \ 543 return show_fan_min(dev, buf, offset); \
544} \ 544} \
545static ssize_t \ 545static ssize_t \
546store_regs_fan_min##offset (struct device *dev, const char *buf, size_t count) \ 546store_regs_fan_min##offset (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \
547{ \ 547{ \
548 return store_fan_min(dev, buf, count, offset); \ 548 return store_fan_min(dev, buf, count, offset); \
549} \ 549} \
@@ -608,19 +608,19 @@ store_temp_reg(HYST, max_hyst);
608 608
609#define sysfs_temp_offset(offset) \ 609#define sysfs_temp_offset(offset) \
610static ssize_t \ 610static ssize_t \
611show_regs_temp_##offset (struct device *dev, char *buf) \ 611show_regs_temp_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
612{ \ 612{ \
613 return show_temp(dev, buf, offset); \ 613 return show_temp(dev, buf, offset); \
614} \ 614} \
615static DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_regs_temp_##offset, NULL); 615static DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_regs_temp_##offset, NULL);
616 616
617#define sysfs_temp_reg_offset(reg, offset) \ 617#define sysfs_temp_reg_offset(reg, offset) \
618static ssize_t show_regs_temp_##reg##offset (struct device *dev, char *buf) \ 618static ssize_t show_regs_temp_##reg##offset (struct device *dev, struct device_attribute *attr, char *buf) \
619{ \ 619{ \
620 return show_temp_##reg (dev, buf, offset); \ 620 return show_temp_##reg (dev, buf, offset); \
621} \ 621} \
622static ssize_t \ 622static ssize_t \
623store_regs_temp_##reg##offset (struct device *dev, \ 623store_regs_temp_##reg##offset (struct device *dev, struct device_attribute *attr, \
624 const char *buf, size_t count) \ 624 const char *buf, size_t count) \
625{ \ 625{ \
626 return store_temp_##reg (dev, buf, count, offset); \ 626 return store_temp_##reg (dev, buf, count, offset); \
@@ -645,7 +645,7 @@ device_create_file(&client->dev, &dev_attr_temp##offset##_max_hyst); \
645} while (0) 645} while (0)
646 646
647static ssize_t 647static ssize_t
648show_vid_reg(struct device *dev, char *buf) 648show_vid_reg(struct device *dev, struct device_attribute *attr, char *buf)
649{ 649{
650 struct w83627hf_data *data = w83627hf_update_device(dev); 650 struct w83627hf_data *data = w83627hf_update_device(dev);
651 return sprintf(buf, "%ld\n", (long) vid_from_reg(data->vid, data->vrm)); 651 return sprintf(buf, "%ld\n", (long) vid_from_reg(data->vid, data->vrm));
@@ -655,13 +655,13 @@ static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid_reg, NULL);
655device_create_file(&client->dev, &dev_attr_cpu0_vid) 655device_create_file(&client->dev, &dev_attr_cpu0_vid)
656 656
657static ssize_t 657static ssize_t
658show_vrm_reg(struct device *dev, char *buf) 658show_vrm_reg(struct device *dev, struct device_attribute *attr, char *buf)
659{ 659{
660 struct w83627hf_data *data = w83627hf_update_device(dev); 660 struct w83627hf_data *data = w83627hf_update_device(dev);
661 return sprintf(buf, "%ld\n", (long) data->vrm); 661 return sprintf(buf, "%ld\n", (long) data->vrm);
662} 662}
663static ssize_t 663static ssize_t
664store_vrm_reg(struct device *dev, const char *buf, size_t count) 664store_vrm_reg(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
665{ 665{
666 struct i2c_client *client = to_i2c_client(dev); 666 struct i2c_client *client = to_i2c_client(dev);
667 struct w83627hf_data *data = i2c_get_clientdata(client); 667 struct w83627hf_data *data = i2c_get_clientdata(client);
@@ -677,7 +677,7 @@ static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm_reg, store_vrm_reg);
677device_create_file(&client->dev, &dev_attr_vrm) 677device_create_file(&client->dev, &dev_attr_vrm)
678 678
679static ssize_t 679static ssize_t
680show_alarms_reg(struct device *dev, char *buf) 680show_alarms_reg(struct device *dev, struct device_attribute *attr, char *buf)
681{ 681{
682 struct w83627hf_data *data = w83627hf_update_device(dev); 682 struct w83627hf_data *data = w83627hf_update_device(dev);
683 return sprintf(buf, "%ld\n", (long) data->alarms); 683 return sprintf(buf, "%ld\n", (long) data->alarms);
@@ -687,7 +687,7 @@ static DEVICE_ATTR(alarms, S_IRUGO, show_alarms_reg, NULL);
687device_create_file(&client->dev, &dev_attr_alarms) 687device_create_file(&client->dev, &dev_attr_alarms)
688 688
689#define show_beep_reg(REG, reg) \ 689#define show_beep_reg(REG, reg) \
690static ssize_t show_beep_##reg (struct device *dev, char *buf) \ 690static ssize_t show_beep_##reg (struct device *dev, struct device_attribute *attr, char *buf) \
691{ \ 691{ \
692 struct w83627hf_data *data = w83627hf_update_device(dev); \ 692 struct w83627hf_data *data = w83627hf_update_device(dev); \
693 return sprintf(buf,"%ld\n", \ 693 return sprintf(buf,"%ld\n", \
@@ -732,12 +732,12 @@ store_beep_reg(struct device *dev, const char *buf, size_t count,
732} 732}
733 733
734#define sysfs_beep(REG, reg) \ 734#define sysfs_beep(REG, reg) \
735static ssize_t show_regs_beep_##reg (struct device *dev, char *buf) \ 735static ssize_t show_regs_beep_##reg (struct device *dev, struct device_attribute *attr, char *buf) \
736{ \ 736{ \
737 return show_beep_##reg(dev, buf); \ 737 return show_beep_##reg(dev, attr, buf); \
738} \ 738} \
739static ssize_t \ 739static ssize_t \
740store_regs_beep_##reg (struct device *dev, const char *buf, size_t count) \ 740store_regs_beep_##reg (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \
741{ \ 741{ \
742 return store_beep_reg(dev, buf, count, BEEP_##REG); \ 742 return store_beep_reg(dev, buf, count, BEEP_##REG); \
743} \ 743} \
@@ -801,12 +801,12 @@ store_fan_div_reg(struct device *dev, const char *buf, size_t count, int nr)
801} 801}
802 802
803#define sysfs_fan_div(offset) \ 803#define sysfs_fan_div(offset) \
804static ssize_t show_regs_fan_div_##offset (struct device *dev, char *buf) \ 804static ssize_t show_regs_fan_div_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
805{ \ 805{ \
806 return show_fan_div_reg(dev, buf, offset); \ 806 return show_fan_div_reg(dev, buf, offset); \
807} \ 807} \
808static ssize_t \ 808static ssize_t \
809store_regs_fan_div_##offset (struct device *dev, \ 809store_regs_fan_div_##offset (struct device *dev, struct device_attribute *attr, \
810 const char *buf, size_t count) \ 810 const char *buf, size_t count) \
811{ \ 811{ \
812 return store_fan_div_reg(dev, buf, count, offset - 1); \ 812 return store_fan_div_reg(dev, buf, count, offset - 1); \
@@ -861,12 +861,12 @@ store_pwm_reg(struct device *dev, const char *buf, size_t count, int nr)
861} 861}
862 862
863#define sysfs_pwm(offset) \ 863#define sysfs_pwm(offset) \
864static ssize_t show_regs_pwm_##offset (struct device *dev, char *buf) \ 864static ssize_t show_regs_pwm_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
865{ \ 865{ \
866 return show_pwm_reg(dev, buf, offset); \ 866 return show_pwm_reg(dev, buf, offset); \
867} \ 867} \
868static ssize_t \ 868static ssize_t \
869store_regs_pwm_##offset (struct device *dev, const char *buf, size_t count) \ 869store_regs_pwm_##offset (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \
870{ \ 870{ \
871 return store_pwm_reg(dev, buf, count, offset); \ 871 return store_pwm_reg(dev, buf, count, offset); \
872} \ 872} \
@@ -937,12 +937,12 @@ store_sensor_reg(struct device *dev, const char *buf, size_t count, int nr)
937} 937}
938 938
939#define sysfs_sensor(offset) \ 939#define sysfs_sensor(offset) \
940static ssize_t show_regs_sensor_##offset (struct device *dev, char *buf) \ 940static ssize_t show_regs_sensor_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
941{ \ 941{ \
942 return show_sensor_reg(dev, buf, offset); \ 942 return show_sensor_reg(dev, buf, offset); \
943} \ 943} \
944static ssize_t \ 944static ssize_t \
945store_regs_sensor_##offset (struct device *dev, const char *buf, size_t count) \ 945store_regs_sensor_##offset (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \
946{ \ 946{ \
947 return store_sensor_reg(dev, buf, count, offset); \ 947 return store_sensor_reg(dev, buf, count, offset); \
948} \ 948} \
diff --git a/drivers/i2c/chips/w83781d.c b/drivers/i2c/chips/w83781d.c
index 4954e465c419..c3926d2d8ac6 100644
--- a/drivers/i2c/chips/w83781d.c
+++ b/drivers/i2c/chips/w83781d.c
@@ -309,18 +309,18 @@ store_in_reg(MAX, max);
309 309
310#define sysfs_in_offset(offset) \ 310#define sysfs_in_offset(offset) \
311static ssize_t \ 311static ssize_t \
312show_regs_in_##offset (struct device *dev, char *buf) \ 312show_regs_in_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
313{ \ 313{ \
314 return show_in(dev, buf, offset); \ 314 return show_in(dev, buf, offset); \
315} \ 315} \
316static DEVICE_ATTR(in##offset##_input, S_IRUGO, show_regs_in_##offset, NULL); 316static DEVICE_ATTR(in##offset##_input, S_IRUGO, show_regs_in_##offset, NULL);
317 317
318#define sysfs_in_reg_offset(reg, offset) \ 318#define sysfs_in_reg_offset(reg, offset) \
319static ssize_t show_regs_in_##reg##offset (struct device *dev, char *buf) \ 319static ssize_t show_regs_in_##reg##offset (struct device *dev, struct device_attribute *attr, char *buf) \
320{ \ 320{ \
321 return show_in_##reg (dev, buf, offset); \ 321 return show_in_##reg (dev, buf, offset); \
322} \ 322} \
323static ssize_t store_regs_in_##reg##offset (struct device *dev, const char *buf, size_t count) \ 323static ssize_t store_regs_in_##reg##offset (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \
324{ \ 324{ \
325 return store_in_##reg (dev, buf, count, offset); \ 325 return store_in_##reg (dev, buf, count, offset); \
326} \ 326} \
@@ -378,18 +378,18 @@ store_fan_min(struct device *dev, const char *buf, size_t count, int nr)
378} 378}
379 379
380#define sysfs_fan_offset(offset) \ 380#define sysfs_fan_offset(offset) \
381static ssize_t show_regs_fan_##offset (struct device *dev, char *buf) \ 381static ssize_t show_regs_fan_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
382{ \ 382{ \
383 return show_fan(dev, buf, offset); \ 383 return show_fan(dev, buf, offset); \
384} \ 384} \
385static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_regs_fan_##offset, NULL); 385static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_regs_fan_##offset, NULL);
386 386
387#define sysfs_fan_min_offset(offset) \ 387#define sysfs_fan_min_offset(offset) \
388static ssize_t show_regs_fan_min##offset (struct device *dev, char *buf) \ 388static ssize_t show_regs_fan_min##offset (struct device *dev, struct device_attribute *attr, char *buf) \
389{ \ 389{ \
390 return show_fan_min(dev, buf, offset); \ 390 return show_fan_min(dev, buf, offset); \
391} \ 391} \
392static ssize_t store_regs_fan_min##offset (struct device *dev, const char *buf, size_t count) \ 392static ssize_t store_regs_fan_min##offset (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \
393{ \ 393{ \
394 return store_fan_min(dev, buf, count, offset); \ 394 return store_fan_min(dev, buf, count, offset); \
395} \ 395} \
@@ -452,18 +452,18 @@ store_temp_reg(HYST, max_hyst);
452 452
453#define sysfs_temp_offset(offset) \ 453#define sysfs_temp_offset(offset) \
454static ssize_t \ 454static ssize_t \
455show_regs_temp_##offset (struct device *dev, char *buf) \ 455show_regs_temp_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
456{ \ 456{ \
457 return show_temp(dev, buf, offset); \ 457 return show_temp(dev, buf, offset); \
458} \ 458} \
459static DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_regs_temp_##offset, NULL); 459static DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_regs_temp_##offset, NULL);
460 460
461#define sysfs_temp_reg_offset(reg, offset) \ 461#define sysfs_temp_reg_offset(reg, offset) \
462static ssize_t show_regs_temp_##reg##offset (struct device *dev, char *buf) \ 462static ssize_t show_regs_temp_##reg##offset (struct device *dev, struct device_attribute *attr, char *buf) \
463{ \ 463{ \
464 return show_temp_##reg (dev, buf, offset); \ 464 return show_temp_##reg (dev, buf, offset); \
465} \ 465} \
466static ssize_t store_regs_temp_##reg##offset (struct device *dev, const char *buf, size_t count) \ 466static ssize_t store_regs_temp_##reg##offset (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \
467{ \ 467{ \
468 return store_temp_##reg (dev, buf, count, offset); \ 468 return store_temp_##reg (dev, buf, count, offset); \
469} \ 469} \
@@ -486,7 +486,7 @@ device_create_file(&client->dev, &dev_attr_temp##offset##_max_hyst); \
486} while (0) 486} while (0)
487 487
488static ssize_t 488static ssize_t
489show_vid_reg(struct device *dev, char *buf) 489show_vid_reg(struct device *dev, struct device_attribute *attr, char *buf)
490{ 490{
491 struct w83781d_data *data = w83781d_update_device(dev); 491 struct w83781d_data *data = w83781d_update_device(dev);
492 return sprintf(buf, "%ld\n", (long) vid_from_reg(data->vid, data->vrm)); 492 return sprintf(buf, "%ld\n", (long) vid_from_reg(data->vid, data->vrm));
@@ -497,14 +497,14 @@ DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid_reg, NULL);
497#define device_create_file_vid(client) \ 497#define device_create_file_vid(client) \
498device_create_file(&client->dev, &dev_attr_cpu0_vid); 498device_create_file(&client->dev, &dev_attr_cpu0_vid);
499static ssize_t 499static ssize_t
500show_vrm_reg(struct device *dev, char *buf) 500show_vrm_reg(struct device *dev, struct device_attribute *attr, char *buf)
501{ 501{
502 struct w83781d_data *data = w83781d_update_device(dev); 502 struct w83781d_data *data = w83781d_update_device(dev);
503 return sprintf(buf, "%ld\n", (long) data->vrm); 503 return sprintf(buf, "%ld\n", (long) data->vrm);
504} 504}
505 505
506static ssize_t 506static ssize_t
507store_vrm_reg(struct device *dev, const char *buf, size_t count) 507store_vrm_reg(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
508{ 508{
509 struct i2c_client *client = to_i2c_client(dev); 509 struct i2c_client *client = to_i2c_client(dev);
510 struct w83781d_data *data = i2c_get_clientdata(client); 510 struct w83781d_data *data = i2c_get_clientdata(client);
@@ -521,7 +521,7 @@ DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm_reg, store_vrm_reg);
521#define device_create_file_vrm(client) \ 521#define device_create_file_vrm(client) \
522device_create_file(&client->dev, &dev_attr_vrm); 522device_create_file(&client->dev, &dev_attr_vrm);
523static ssize_t 523static ssize_t
524show_alarms_reg(struct device *dev, char *buf) 524show_alarms_reg(struct device *dev, struct device_attribute *attr, char *buf)
525{ 525{
526 struct w83781d_data *data = w83781d_update_device(dev); 526 struct w83781d_data *data = w83781d_update_device(dev);
527 return sprintf(buf, "%ld\n", (long) ALARMS_FROM_REG(data->alarms)); 527 return sprintf(buf, "%ld\n", (long) ALARMS_FROM_REG(data->alarms));
@@ -531,13 +531,13 @@ static
531DEVICE_ATTR(alarms, S_IRUGO, show_alarms_reg, NULL); 531DEVICE_ATTR(alarms, S_IRUGO, show_alarms_reg, NULL);
532#define device_create_file_alarms(client) \ 532#define device_create_file_alarms(client) \
533device_create_file(&client->dev, &dev_attr_alarms); 533device_create_file(&client->dev, &dev_attr_alarms);
534static ssize_t show_beep_mask (struct device *dev, char *buf) 534static ssize_t show_beep_mask (struct device *dev, struct device_attribute *attr, char *buf)
535{ 535{
536 struct w83781d_data *data = w83781d_update_device(dev); 536 struct w83781d_data *data = w83781d_update_device(dev);
537 return sprintf(buf, "%ld\n", 537 return sprintf(buf, "%ld\n",
538 (long)BEEP_MASK_FROM_REG(data->beep_mask, data->type)); 538 (long)BEEP_MASK_FROM_REG(data->beep_mask, data->type));
539} 539}
540static ssize_t show_beep_enable (struct device *dev, char *buf) 540static ssize_t show_beep_enable (struct device *dev, struct device_attribute *attr, char *buf)
541{ 541{
542 struct w83781d_data *data = w83781d_update_device(dev); 542 struct w83781d_data *data = w83781d_update_device(dev);
543 return sprintf(buf, "%ld\n", 543 return sprintf(buf, "%ld\n",
@@ -583,11 +583,11 @@ store_beep_reg(struct device *dev, const char *buf, size_t count,
583} 583}
584 584
585#define sysfs_beep(REG, reg) \ 585#define sysfs_beep(REG, reg) \
586static ssize_t show_regs_beep_##reg (struct device *dev, char *buf) \ 586static ssize_t show_regs_beep_##reg (struct device *dev, struct device_attribute *attr, char *buf) \
587{ \ 587{ \
588 return show_beep_##reg(dev, buf); \ 588 return show_beep_##reg(dev, attr, buf); \
589} \ 589} \
590static ssize_t store_regs_beep_##reg (struct device *dev, const char *buf, size_t count) \ 590static ssize_t store_regs_beep_##reg (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \
591{ \ 591{ \
592 return store_beep_reg(dev, buf, count, BEEP_##REG); \ 592 return store_beep_reg(dev, buf, count, BEEP_##REG); \
593} \ 593} \
@@ -653,11 +653,11 @@ store_fan_div_reg(struct device *dev, const char *buf, size_t count, int nr)
653} 653}
654 654
655#define sysfs_fan_div(offset) \ 655#define sysfs_fan_div(offset) \
656static ssize_t show_regs_fan_div_##offset (struct device *dev, char *buf) \ 656static ssize_t show_regs_fan_div_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
657{ \ 657{ \
658 return show_fan_div_reg(dev, buf, offset); \ 658 return show_fan_div_reg(dev, buf, offset); \
659} \ 659} \
660static ssize_t store_regs_fan_div_##offset (struct device *dev, const char *buf, size_t count) \ 660static ssize_t store_regs_fan_div_##offset (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \
661{ \ 661{ \
662 return store_fan_div_reg(dev, buf, count, offset - 1); \ 662 return store_fan_div_reg(dev, buf, count, offset - 1); \
663} \ 663} \
@@ -737,11 +737,11 @@ store_pwmenable_reg(struct device *dev, const char *buf, size_t count, int nr)
737} 737}
738 738
739#define sysfs_pwm(offset) \ 739#define sysfs_pwm(offset) \
740static ssize_t show_regs_pwm_##offset (struct device *dev, char *buf) \ 740static ssize_t show_regs_pwm_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
741{ \ 741{ \
742 return show_pwm_reg(dev, buf, offset); \ 742 return show_pwm_reg(dev, buf, offset); \
743} \ 743} \
744static ssize_t store_regs_pwm_##offset (struct device *dev, \ 744static ssize_t store_regs_pwm_##offset (struct device *dev, struct device_attribute *attr, \
745 const char *buf, size_t count) \ 745 const char *buf, size_t count) \
746{ \ 746{ \
747 return store_pwm_reg(dev, buf, count, offset); \ 747 return store_pwm_reg(dev, buf, count, offset); \
@@ -750,11 +750,11 @@ static DEVICE_ATTR(pwm##offset, S_IRUGO | S_IWUSR, \
750 show_regs_pwm_##offset, store_regs_pwm_##offset); 750 show_regs_pwm_##offset, store_regs_pwm_##offset);
751 751
752#define sysfs_pwmenable(offset) \ 752#define sysfs_pwmenable(offset) \
753static ssize_t show_regs_pwmenable_##offset (struct device *dev, char *buf) \ 753static ssize_t show_regs_pwmenable_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
754{ \ 754{ \
755 return show_pwmenable_reg(dev, buf, offset); \ 755 return show_pwmenable_reg(dev, buf, offset); \
756} \ 756} \
757static ssize_t store_regs_pwmenable_##offset (struct device *dev, \ 757static ssize_t store_regs_pwmenable_##offset (struct device *dev, struct device_attribute *attr, \
758 const char *buf, size_t count) \ 758 const char *buf, size_t count) \
759{ \ 759{ \
760 return store_pwmenable_reg(dev, buf, count, offset); \ 760 return store_pwmenable_reg(dev, buf, count, offset); \
@@ -832,11 +832,11 @@ store_sensor_reg(struct device *dev, const char *buf, size_t count, int nr)
832} 832}
833 833
834#define sysfs_sensor(offset) \ 834#define sysfs_sensor(offset) \
835static ssize_t show_regs_sensor_##offset (struct device *dev, char *buf) \ 835static ssize_t show_regs_sensor_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
836{ \ 836{ \
837 return show_sensor_reg(dev, buf, offset); \ 837 return show_sensor_reg(dev, buf, offset); \
838} \ 838} \
839static ssize_t store_regs_sensor_##offset (struct device *dev, const char *buf, size_t count) \ 839static ssize_t store_regs_sensor_##offset (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \
840{ \ 840{ \
841 return store_sensor_reg(dev, buf, count, offset); \ 841 return store_sensor_reg(dev, buf, count, offset); \
842} \ 842} \
diff --git a/drivers/i2c/chips/w83l785ts.c b/drivers/i2c/chips/w83l785ts.c
index 59bbc5881fa6..74d4b58e4237 100644
--- a/drivers/i2c/chips/w83l785ts.c
+++ b/drivers/i2c/chips/w83l785ts.c
@@ -118,13 +118,13 @@ struct w83l785ts_data {
118 * Sysfs stuff 118 * Sysfs stuff
119 */ 119 */
120 120
121static ssize_t show_temp(struct device *dev, char *buf) 121static ssize_t show_temp(struct device *dev, struct device_attribute *attr, char *buf)
122{ 122{
123 struct w83l785ts_data *data = w83l785ts_update_device(dev); 123 struct w83l785ts_data *data = w83l785ts_update_device(dev);
124 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp)); 124 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp));
125} 125}
126 126
127static ssize_t show_temp_over(struct device *dev, char *buf) 127static ssize_t show_temp_over(struct device *dev, struct device_attribute *attr, char *buf)
128{ 128{
129 struct w83l785ts_data *data = w83l785ts_update_device(dev); 129 struct w83l785ts_data *data = w83l785ts_update_device(dev);
130 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_over)); 130 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_over));
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 9011627d7eb0..a22e53badacb 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -103,7 +103,7 @@ static struct class i2c_adapter_class = {
103 .release = &i2c_adapter_class_dev_release, 103 .release = &i2c_adapter_class_dev_release,
104}; 104};
105 105
106static ssize_t show_adapter_name(struct device *dev, char *buf) 106static ssize_t show_adapter_name(struct device *dev, struct device_attribute *attr, char *buf)
107{ 107{
108 struct i2c_adapter *adap = dev_to_i2c_adapter(dev); 108 struct i2c_adapter *adap = dev_to_i2c_adapter(dev);
109 return sprintf(buf, "%s\n", adap->name); 109 return sprintf(buf, "%s\n", adap->name);
@@ -117,7 +117,7 @@ static void i2c_client_release(struct device *dev)
117 complete(&client->released); 117 complete(&client->released);
118} 118}
119 119
120static ssize_t show_client_name(struct device *dev, char *buf) 120static ssize_t show_client_name(struct device *dev, struct device_attribute *attr, char *buf)
121{ 121{
122 struct i2c_client *client = to_i2c_client(dev); 122 struct i2c_client *client = to_i2c_client(dev);
123 return sprintf(buf, "%s\n", client->name); 123 return sprintf(buf, "%s\n", client->name);