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/lm78.c | |
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/lm78.c')
-rw-r--r-- | drivers/i2c/chips/lm78.c | 36 |
1 files changed, 18 insertions, 18 deletions
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); |