diff options
author | Yani Ioannou <yani.ioannou@gmail.com> | 2005-05-17 06:42:03 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-06-20 18:15:33 -0400 |
commit | 8627f9ba531269d8850919c62af1b017438e2e79 (patch) | |
tree | ed560594954e5e2303c98bbc8fb83ec7e0dec661 /drivers/i2c/chips | |
parent | 30f74292e50d6c4ae438dbee5cb45d77bf774351 (diff) |
[PATCH] Driver Core: drivers/i2c/chips/lm77.c - max1619.c: update device attribute callbacks
Signed-off-by: Yani Ioannou <yani.ioannou@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/i2c/chips')
-rw-r--r-- | drivers/i2c/chips/lm77.c | 14 | ||||
-rw-r--r-- | drivers/i2c/chips/lm78.c | 36 | ||||
-rw-r--r-- | drivers/i2c/chips/lm80.c | 20 | ||||
-rw-r--r-- | drivers/i2c/chips/lm83.c | 6 | ||||
-rw-r--r-- | drivers/i2c/chips/lm85.c | 72 | ||||
-rw-r--r-- | drivers/i2c/chips/lm87.c | 46 | ||||
-rw-r--r-- | drivers/i2c/chips/lm90.c | 12 | ||||
-rw-r--r-- | drivers/i2c/chips/lm92.c | 14 | ||||
-rw-r--r-- | drivers/i2c/chips/max1619.c | 6 |
9 files changed, 113 insertions, 113 deletions
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) \ |
106 | static ssize_t show_##value(struct device *dev, char *buf) \ | 106 | static 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); | |||
116 | show(alarms); | 116 | show(alarms); |
117 | 117 | ||
118 | /* read routines for hysteresis values */ | 118 | /* read routines for hysteresis values */ |
119 | static ssize_t show_temp_crit_hyst(struct device *dev, char *buf) | 119 | static 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 | } |
124 | static ssize_t show_temp_min_hyst(struct device *dev, char *buf) | 124 | static 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 | } |
129 | static ssize_t show_temp_max_hyst(struct device *dev, char *buf) | 129 | static 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) \ |
137 | static ssize_t set_##value(struct device *dev, const char *buf, size_t count) \ | 137 | static 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 */ |
155 | static ssize_t set_temp_crit_hyst(struct device *dev, const char *buf, size_t count) | 155 | static 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 */ |
170 | static ssize_t set_temp_crit(struct device *dev, const char *buf, size_t count) | 170 | static 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) \ |
226 | static ssize_t \ | 226 | static 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 | } \ |
231 | static DEVICE_ATTR(in##offset##_input, S_IRUGO, \ | 231 | static DEVICE_ATTR(in##offset##_input, S_IRUGO, \ |
232 | show_in##offset, NULL); \ | 232 | show_in##offset, NULL); \ |
233 | static ssize_t \ | 233 | static 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 | } \ |
238 | static ssize_t \ | 238 | static 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 | } \ |
243 | static ssize_t set_in##offset##_min (struct device *dev, \ | 243 | static 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 | } \ |
248 | static ssize_t set_in##offset##_max (struct device *dev, \ | 248 | static 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); | |||
264 | show_in_offset(6); | 264 | show_in_offset(6); |
265 | 265 | ||
266 | /* Temperature */ | 266 | /* Temperature */ |
267 | static ssize_t show_temp(struct device *dev, char *buf) | 267 | static 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 | ||
273 | static ssize_t show_temp_over(struct device *dev, char *buf) | 273 | static 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 | ||
279 | static ssize_t set_temp_over(struct device *dev, const char *buf, size_t count) | 279 | static 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 | ||
292 | static ssize_t show_temp_hyst(struct device *dev, char *buf) | 292 | static 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 | ||
298 | static ssize_t set_temp_hyst(struct device *dev, const char *buf, size_t count) | 298 | static 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) \ |
401 | static ssize_t show_fan_##offset (struct device *dev, char *buf) \ | 401 | static 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 | } \ |
405 | static ssize_t show_fan_##offset##_min (struct device *dev, char *buf) \ | 405 | static 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 | } \ |
409 | static ssize_t show_fan_##offset##_div (struct device *dev, char *buf) \ | 409 | static 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 | } \ |
413 | static ssize_t set_fan_##offset##_min (struct device *dev, \ | 413 | static 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);\ | |||
419 | static DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR, \ | 419 | static 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 | ||
422 | static ssize_t set_fan_1_div(struct device *dev, const char *buf, | 422 | static 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 | ||
428 | static ssize_t set_fan_2_div(struct device *dev, const char *buf, | 428 | static 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, | |||
443 | static DEVICE_ATTR(fan3_div, S_IRUGO, show_fan_3_div, NULL); | 443 | static DEVICE_ATTR(fan3_div, S_IRUGO, show_fan_3_div, NULL); |
444 | 444 | ||
445 | /* VID */ | 445 | /* VID */ |
446 | static ssize_t show_vid(struct device *dev, char *buf) | 446 | static 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) | |||
451 | static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid, NULL); | 451 | static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid, NULL); |
452 | 452 | ||
453 | /* Alarms */ | 453 | /* Alarms */ |
454 | static ssize_t show_alarms(struct device *dev, char *buf) | 454 | static 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) \ |
159 | static ssize_t show_in_##suffix(struct device *dev, char *buf) \ | 159 | static 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]); | |||
184 | show_in(input6, in[6]); | 184 | show_in(input6, in[6]); |
185 | 185 | ||
186 | #define set_in(suffix, value, reg) \ | 186 | #define set_in(suffix, value, reg) \ |
187 | static ssize_t set_in_##suffix(struct device *dev, const char *buf, \ | 187 | static 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)); | |||
213 | set_in(max6, in_max[6], LM80_REG_IN_MAX(6)); | 213 | set_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) \ |
216 | static ssize_t show_fan_##suffix(struct device *dev, char *buf) \ | 216 | static 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]); | |||
225 | show_fan(input2, fan[1], fan_div[1]); | 225 | show_fan(input2, fan[1], fan_div[1]); |
226 | 226 | ||
227 | #define show_fan_div(suffix, value) \ | 227 | #define show_fan_div(suffix, value) \ |
228 | static ssize_t show_fan_div##suffix(struct device *dev, char *buf) \ | 228 | static 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]); | |||
234 | show_fan_div(2, fan_div[1]); | 234 | show_fan_div(2, fan_div[1]); |
235 | 235 | ||
236 | #define set_fan(suffix, value, reg, div) \ | 236 | #define set_fan(suffix, value, reg, div) \ |
237 | static ssize_t set_fan_##suffix(struct device *dev, const char *buf, \ | 237 | static 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) \ |
295 | static ssize_t set_fan_div##number(struct device *dev, const char *buf, \ | 295 | static 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, \ | |||
300 | set_fan_div(1); | 300 | set_fan_div(1); |
301 | set_fan_div(2); | 301 | set_fan_div(2); |
302 | 302 | ||
303 | static ssize_t show_temp_input1(struct device *dev, char *buf) | 303 | static 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) \ |
310 | static ssize_t show_temp_##suffix(struct device *dev, char *buf) \ | 310 | static 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); | |||
318 | show_temp(os_hyst, temp_os_hyst); | 318 | show_temp(os_hyst, temp_os_hyst); |
319 | 319 | ||
320 | #define set_temp(suffix, value, reg) \ | 320 | #define set_temp(suffix, value, reg) \ |
321 | static ssize_t set_temp_##suffix(struct device *dev, const char *buf, \ | 321 | static 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); | |||
336 | set_temp(os_max, temp_os_max, LM80_REG_TEMP_OS_MAX); | 336 | set_temp(os_max, temp_os_max, LM80_REG_TEMP_OS_MAX); |
337 | set_temp(os_hyst, temp_os_hyst, LM80_REG_TEMP_OS_HYST); | 337 | set_temp(os_hyst, temp_os_hyst, LM80_REG_TEMP_OS_HYST); |
338 | 338 | ||
339 | static ssize_t show_alarms(struct device *dev, char *buf) | 339 | static 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) \ |
158 | static ssize_t show_temp_##suffix(struct device *dev, char *buf) \ | 158 | static 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]); | |||
171 | show_temp(crit, temp_crit); | 171 | show_temp(crit, temp_crit); |
172 | 172 | ||
173 | #define set_temp(suffix, value, reg) \ | 173 | #define set_temp(suffix, value, reg) \ |
174 | static ssize_t set_temp_##suffix(struct device *dev, const char *buf, \ | 174 | static 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); | |||
190 | set_temp(high4, temp_high[3], LM83_REG_W_REMOTE3_HIGH); | 190 | set_temp(high4, temp_high[3], LM83_REG_W_REMOTE3_HIGH); |
191 | set_temp(crit, temp_crit, LM83_REG_W_TCRIT); | 191 | set_temp(crit, temp_crit, LM83_REG_W_TCRIT); |
192 | 192 | ||
193 | static ssize_t show_alarms(struct device *dev, char *buf) | 193 | static 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) \ |
429 | static ssize_t show_fan_##offset (struct device *dev, char *buf) \ | 429 | static 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 | } \ |
433 | static ssize_t show_fan_##offset##_min (struct device *dev, char *buf) \ | 433 | static 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 | } \ |
437 | static ssize_t set_fan_##offset##_min (struct device *dev, \ | 437 | static 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 | ||
454 | static ssize_t show_vid_reg(struct device *dev, char *buf) | 454 | static 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 | ||
460 | static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid_reg, NULL); | 460 | static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid_reg, NULL); |
461 | 461 | ||
462 | static ssize_t show_vrm_reg(struct device *dev, char *buf) | 462 | static 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 | ||
468 | static ssize_t store_vrm_reg(struct device *dev, const char *buf, size_t count) | 468 | static 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 | ||
479 | static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm_reg, store_vrm_reg); | 479 | static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm_reg, store_vrm_reg); |
480 | 480 | ||
481 | static ssize_t show_alarms_reg(struct device *dev, char *buf) | 481 | static 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) \ |
519 | static ssize_t show_pwm_##offset (struct device *dev, char *buf) \ | 519 | static 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 | } \ |
523 | static ssize_t set_pwm_##offset (struct device *dev, \ | 523 | static 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 | } \ |
528 | static ssize_t show_pwm_enable##offset (struct device *dev, char *buf) \ | 528 | static 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) \ |
588 | static ssize_t show_in_##offset (struct device *dev, char *buf) \ | 588 | static 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 | } \ |
592 | static ssize_t show_in_##offset##_min (struct device *dev, char *buf) \ | 592 | static 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 | } \ |
596 | static ssize_t show_in_##offset##_max (struct device *dev, char *buf) \ | 596 | static 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 | } \ |
600 | static ssize_t set_in_##offset##_min (struct device *dev, \ | 600 | static 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 | } \ |
605 | static ssize_t set_in_##offset##_max (struct device *dev, \ | 605 | static 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) \ |
669 | static ssize_t show_temp_##offset (struct device *dev, char *buf) \ | 669 | static 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 | } \ |
673 | static ssize_t show_temp_##offset##_min (struct device *dev, char *buf) \ | 673 | static 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 | } \ |
677 | static ssize_t show_temp_##offset##_max (struct device *dev, char *buf) \ | 677 | static 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 | } \ |
681 | static ssize_t set_temp_##offset##_min (struct device *dev, \ | 681 | static 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 | } \ |
686 | static ssize_t set_temp_##offset##_max (struct device *dev, \ | 686 | static 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) \ |
789 | static ssize_t show_pwm##offset##_auto_channels (struct device *dev, \ | 789 | static 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 | } \ |
794 | static ssize_t set_pwm##offset##_auto_channels (struct device *dev, \ | 794 | static 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 | } \ |
799 | static ssize_t show_pwm##offset##_auto_pwm_min (struct device *dev, \ | 799 | static 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 | } \ |
804 | static ssize_t set_pwm##offset##_auto_pwm_min (struct device *dev, \ | 804 | static 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 | } \ |
809 | static ssize_t show_pwm##offset##_auto_pwm_minctl (struct device *dev, \ | 809 | static 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 | } \ |
814 | static ssize_t set_pwm##offset##_auto_pwm_minctl (struct device *dev, \ | 814 | static 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 | } \ |
819 | static ssize_t show_pwm##offset##_auto_pwm_freq (struct device *dev, \ | 819 | static 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 | } \ |
824 | static ssize_t set_pwm##offset##_auto_pwm_freq(struct device *dev, \ | 824 | static 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) \ |
965 | static ssize_t show_temp##offset##_auto_temp_off (struct device *dev, \ | 965 | static 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 | } \ |
970 | static ssize_t set_temp##offset##_auto_temp_off (struct device *dev, \ | 970 | static 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 | } \ |
975 | static ssize_t show_temp##offset##_auto_temp_min (struct device *dev, \ | 975 | static 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 | } \ |
980 | static ssize_t set_temp##offset##_auto_temp_min (struct device *dev, \ | 980 | static 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 | } \ |
985 | static ssize_t show_temp##offset##_auto_temp_max (struct device *dev, \ | 985 | static 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 | } \ |
990 | static ssize_t set_temp##offset##_auto_temp_max (struct device *dev, \ | 990 | static 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 | } \ |
995 | static ssize_t show_temp##offset##_auto_temp_crit (struct device *dev, \ | 995 | static 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 | } \ |
1000 | static ssize_t set_temp##offset##_auto_temp_crit (struct device *dev, \ | 1000 | static 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) \ |
221 | static ssize_t show_in##offset##_input(struct device *dev, char *buf) \ | 221 | static 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 | } \ |
227 | static ssize_t show_in##offset##_min(struct device *dev, char *buf) \ | 227 | static 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 | } \ |
233 | static ssize_t show_in##offset##_max(struct device *dev, char *buf) \ | 233 | static 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) \ |
277 | static ssize_t set_in##offset##_min(struct device *dev, \ | 277 | static 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 | } \ |
283 | static ssize_t set_in##offset##_max(struct device *dev, \ | 283 | static 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); | |||
300 | set_in(7); | 300 | set_in(7); |
301 | 301 | ||
302 | #define show_temp(offset) \ | 302 | #define show_temp(offset) \ |
303 | static ssize_t show_temp##offset##_input(struct device *dev, char *buf) \ | 303 | static 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 | } \ |
308 | static ssize_t show_temp##offset##_low(struct device *dev, char *buf) \ | 308 | static 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 | } \ |
313 | static ssize_t show_temp##offset##_high(struct device *dev, char *buf) \ | 313 | static 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) \ |
349 | static ssize_t set_temp##offset##_low(struct device *dev, \ | 349 | static 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 | } \ |
355 | static ssize_t set_temp##offset##_high(struct device *dev, \ | 355 | static 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); | |||
366 | set_temp(2); | 366 | set_temp(2); |
367 | set_temp(3); | 367 | set_temp(3); |
368 | 368 | ||
369 | static ssize_t show_temp_crit_int(struct device *dev, char *buf) | 369 | static 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 | ||
375 | static ssize_t show_temp_crit_ext(struct device *dev, char *buf) | 375 | static 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); | |||
383 | static DEVICE_ATTR(temp3_crit, S_IRUGO, show_temp_crit_ext, NULL); | 383 | static DEVICE_ATTR(temp3_crit, S_IRUGO, show_temp_crit_ext, NULL); |
384 | 384 | ||
385 | #define show_fan(offset) \ | 385 | #define show_fan(offset) \ |
386 | static ssize_t show_fan##offset##_input(struct device *dev, char *buf) \ | 386 | static 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 | } \ |
392 | static ssize_t show_fan##offset##_min(struct device *dev, char *buf) \ | 392 | static 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 | } \ |
398 | static ssize_t show_fan##offset##_div(struct device *dev, char *buf) \ | 398 | static 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) \ |
468 | static ssize_t set_fan##offset##_min(struct device *dev, const char *buf, \ | 468 | static 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 | } \ |
474 | static ssize_t set_fan##offset##_div(struct device *dev, const char *buf, \ | 474 | static 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, \ | |||
483 | set_fan(1); | 483 | set_fan(1); |
484 | set_fan(2); | 484 | set_fan(2); |
485 | 485 | ||
486 | static ssize_t show_alarms(struct device *dev, char *buf) | 486 | static 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 | } |
491 | static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL); | 491 | static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL); |
492 | 492 | ||
493 | static ssize_t show_vid(struct device *dev, char *buf) | 493 | static 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 | } |
498 | static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid, NULL); | 498 | static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid, NULL); |
499 | 499 | ||
500 | static ssize_t show_vrm(struct device *dev, char *buf) | 500 | static 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 | } |
505 | static ssize_t set_vrm(struct device *dev, const char *buf, size_t count) | 505 | static 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 | } |
512 | static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm, set_vrm); | 512 | static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm, set_vrm); |
513 | 513 | ||
514 | static ssize_t show_aout(struct device *dev, char *buf) | 514 | static 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 | } |
519 | static ssize_t set_aout(struct device *dev, const char *buf, size_t count) | 519 | static 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) \ |
221 | static ssize_t show_##value(struct device *dev, char *buf) \ | 221 | static 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); | |||
233 | show_temp(temp_crit2, TEMP1_FROM_REG); | 233 | show_temp(temp_crit2, TEMP1_FROM_REG); |
234 | 234 | ||
235 | #define set_temp1(value, reg) \ | 235 | #define set_temp1(value, reg) \ |
236 | static ssize_t set_##value(struct device *dev, const char *buf, \ | 236 | static 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) \ |
253 | static ssize_t set_##value(struct device *dev, const char *buf, \ | 253 | static 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); | |||
275 | set_temp1(temp_crit2, LM90_REG_W_REMOTE_CRIT); | 275 | set_temp1(temp_crit2, LM90_REG_W_REMOTE_CRIT); |
276 | 276 | ||
277 | #define show_temp_hyst(value, basereg) \ | 277 | #define show_temp_hyst(value, basereg) \ |
278 | static ssize_t show_##value(struct device *dev, char *buf) \ | 278 | static 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) \ | |||
284 | show_temp_hyst(temp_hyst1, temp_crit1); | 284 | show_temp_hyst(temp_hyst1, temp_crit1); |
285 | show_temp_hyst(temp_hyst2, temp_crit2); | 285 | show_temp_hyst(temp_hyst2, temp_crit2); |
286 | 286 | ||
287 | static ssize_t set_temp_hyst1(struct device *dev, const char *buf, | 287 | static 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 | ||
303 | static ssize_t show_alarms(struct device *dev, char *buf) | 303 | static 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) \ |
143 | static ssize_t show_##value(struct device *dev, char *buf) \ | 143 | static 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); | |||
151 | show_temp(temp1_max); | 151 | show_temp(temp1_max); |
152 | 152 | ||
153 | #define set_temp(value, reg) \ | 153 | #define set_temp(value, reg) \ |
154 | static ssize_t set_##value(struct device *dev, const char *buf, \ | 154 | static 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); | |||
168 | set_temp(temp1_min, LM92_REG_TEMP_LOW); | 168 | set_temp(temp1_min, LM92_REG_TEMP_LOW); |
169 | set_temp(temp1_max, LM92_REG_TEMP_HIGH); | 169 | set_temp(temp1_max, LM92_REG_TEMP_HIGH); |
170 | 170 | ||
171 | static ssize_t show_temp1_crit_hyst(struct device *dev, char *buf) | 171 | static 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 | } |
177 | static ssize_t show_temp1_max_hyst(struct device *dev, char *buf) | 177 | static 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 | } |
183 | static ssize_t show_temp1_min_hyst(struct device *dev, char *buf) | 183 | static 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 | ||
190 | static ssize_t set_temp1_crit_hyst(struct device *dev, const char *buf, | 190 | static 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 | ||
205 | static ssize_t show_alarms(struct device *dev, char *buf) | 205 | static 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) \ |
125 | static ssize_t show_##value(struct device *dev, char *buf) \ | 125 | static 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); | |||
135 | show_temp(temp_hyst2); | 135 | show_temp(temp_hyst2); |
136 | 136 | ||
137 | #define set_temp2(value, reg) \ | 137 | #define set_temp2(value, reg) \ |
138 | static ssize_t set_##value(struct device *dev, const char *buf, \ | 138 | static 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); | |||
154 | set_temp2(temp_crit2, MAX1619_REG_W_REMOTE_CRIT); | 154 | set_temp2(temp_crit2, MAX1619_REG_W_REMOTE_CRIT); |
155 | set_temp2(temp_hyst2, MAX1619_REG_W_TCRIT_HYST); | 155 | set_temp2(temp_hyst2, MAX1619_REG_W_TCRIT_HYST); |
156 | 156 | ||
157 | static ssize_t show_alarms(struct device *dev, char *buf) | 157 | static 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); |