diff options
author | Yani Ioannou <yani.ioannou@gmail.com> | 2005-05-17 06:41:35 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-06-20 18:15:33 -0400 |
commit | 30f74292e50d6c4ae438dbee5cb45d77bf774351 (patch) | |
tree | 4bfa1b6715ecd597e196a9f448c825ef0c12d8e3 /drivers/i2c/chips/asb100.c | |
parent | 74880c063b06efd103c924abfe19d9d8fa4864c4 (diff) |
[PATCH] Driver Core: drivers/i2c/chips/adm1031.c - lm75.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/asb100.c')
-rw-r--r-- | drivers/i2c/chips/asb100.c | 46 |
1 files changed, 23 insertions, 23 deletions
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) \ |
262 | static ssize_t \ | 262 | static 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 | } \ |
267 | static DEVICE_ATTR(in##offset##_input, S_IRUGO, \ | 267 | static DEVICE_ATTR(in##offset##_input, S_IRUGO, \ |
268 | show_in##offset, NULL); \ | 268 | show_in##offset, NULL); \ |
269 | static ssize_t \ | 269 | static 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 | } \ |
274 | static ssize_t \ | 274 | static 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 | } \ |
279 | static ssize_t set_in##offset##_min (struct device *dev, \ | 279 | static 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 | } \ |
284 | static ssize_t set_in##offset##_max (struct device *dev, \ | 284 | static 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) \ |
392 | static ssize_t show_fan##offset(struct device *dev, char *buf) \ | 392 | static 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 | } \ |
396 | static ssize_t show_fan##offset##_min(struct device *dev, char *buf) \ | 396 | static 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 | } \ |
400 | static ssize_t show_fan##offset##_div(struct device *dev, char *buf) \ | 400 | static 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 | } \ |
404 | static ssize_t set_fan##offset##_min(struct device *dev, const char *buf, \ | 404 | static 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 | } \ |
409 | static ssize_t set_fan##offset##_div(struct device *dev, const char *buf, \ | 409 | static 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); | |||
482 | set_temp_reg(HYST, temp_hyst); | 482 | set_temp_reg(HYST, temp_hyst); |
483 | 483 | ||
484 | #define sysfs_temp(num) \ | 484 | #define sysfs_temp(num) \ |
485 | static ssize_t show_temp##num(struct device *dev, char *buf) \ | 485 | static 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 | } \ |
489 | static DEVICE_ATTR(temp##num##_input, S_IRUGO, show_temp##num, NULL); \ | 489 | static DEVICE_ATTR(temp##num##_input, S_IRUGO, show_temp##num, NULL); \ |
490 | static ssize_t show_temp_max##num(struct device *dev, char *buf) \ | 490 | static 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 | } \ |
494 | static ssize_t set_temp_max##num(struct device *dev, const char *buf, \ | 494 | static 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 | } \ |
499 | static DEVICE_ATTR(temp##num##_max, S_IRUGO | S_IWUSR, \ | 499 | static 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); \ |
501 | static ssize_t show_temp_hyst##num(struct device *dev, char *buf) \ | 501 | static 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 | } \ |
505 | static ssize_t set_temp_hyst##num(struct device *dev, const char *buf, \ | 505 | static 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 | ||
525 | static ssize_t show_vid(struct device *dev, char *buf) | 525 | static 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); | |||
533 | device_create_file(&client->dev, &dev_attr_cpu0_vid) | 533 | device_create_file(&client->dev, &dev_attr_cpu0_vid) |
534 | 534 | ||
535 | /* VRM */ | 535 | /* VRM */ |
536 | static ssize_t show_vrm(struct device *dev, char *buf) | 536 | static 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 | ||
542 | static ssize_t set_vrm(struct device *dev, const char *buf, size_t count) | 542 | static 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) \ |
554 | device_create_file(&client->dev, &dev_attr_vrm); | 554 | device_create_file(&client->dev, &dev_attr_vrm); |
555 | 555 | ||
556 | static ssize_t show_alarms(struct device *dev, char *buf) | 556 | static 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); | |||
564 | device_create_file(&client->dev, &dev_attr_alarms) | 564 | device_create_file(&client->dev, &dev_attr_alarms) |
565 | 565 | ||
566 | /* 1 PWM */ | 566 | /* 1 PWM */ |
567 | static ssize_t show_pwm1(struct device *dev, char *buf) | 567 | static 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 | ||
573 | static ssize_t set_pwm1(struct device *dev, const char *buf, size_t count) | 573 | static 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 | ||
587 | static ssize_t show_pwm_enable1(struct device *dev, char *buf) | 587 | static 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 | ||
593 | static ssize_t set_pwm_enable1(struct device *dev, const char *buf, | 593 | static 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); |