aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/chips/lm85.c
diff options
context:
space:
mode:
authorYani Ioannou <yani.ioannou@gmail.com>2005-05-17 06:42:03 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-06-20 18:15:33 -0400
commit8627f9ba531269d8850919c62af1b017438e2e79 (patch)
treeed560594954e5e2303c98bbc8fb83ec7e0dec661 /drivers/i2c/chips/lm85.c
parent30f74292e50d6c4ae438dbee5cb45d77bf774351 (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/lm85.c')
-rw-r--r--drivers/i2c/chips/lm85.c72
1 files changed, 36 insertions, 36 deletions
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); \