aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/chips/adm1031.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/i2c/chips/adm1031.c')
-rw-r--r--drivers/i2c/chips/adm1031.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/drivers/i2c/chips/adm1031.c b/drivers/i2c/chips/adm1031.c
index d4385a23f79a..9168e983ca1d 100644
--- a/drivers/i2c/chips/adm1031.c
+++ b/drivers/i2c/chips/adm1031.c
@@ -292,11 +292,11 @@ set_fan_auto_channel(struct device *dev, const char *buf, size_t count, int nr)
292} 292}
293 293
294#define fan_auto_channel_offset(offset) \ 294#define fan_auto_channel_offset(offset) \
295static ssize_t show_fan_auto_channel_##offset (struct device *dev, char *buf) \ 295static ssize_t show_fan_auto_channel_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
296{ \ 296{ \
297 return show_fan_auto_channel(dev, buf, offset - 1); \ 297 return show_fan_auto_channel(dev, buf, offset - 1); \
298} \ 298} \
299static ssize_t set_fan_auto_channel_##offset (struct device *dev, \ 299static ssize_t set_fan_auto_channel_##offset (struct device *dev, struct device_attribute *attr, \
300 const char *buf, size_t count) \ 300 const char *buf, size_t count) \
301{ \ 301{ \
302 return set_fan_auto_channel(dev, buf, count, offset - 1); \ 302 return set_fan_auto_channel(dev, buf, count, offset - 1); \
@@ -357,24 +357,24 @@ set_auto_temp_max(struct device *dev, const char *buf, size_t count, int nr)
357} 357}
358 358
359#define auto_temp_reg(offset) \ 359#define auto_temp_reg(offset) \
360static ssize_t show_auto_temp_##offset##_off (struct device *dev, char *buf) \ 360static ssize_t show_auto_temp_##offset##_off (struct device *dev, struct device_attribute *attr, char *buf) \
361{ \ 361{ \
362 return show_auto_temp_off(dev, buf, offset - 1); \ 362 return show_auto_temp_off(dev, buf, offset - 1); \
363} \ 363} \
364static ssize_t show_auto_temp_##offset##_min (struct device *dev, char *buf) \ 364static ssize_t show_auto_temp_##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \
365{ \ 365{ \
366 return show_auto_temp_min(dev, buf, offset - 1); \ 366 return show_auto_temp_min(dev, buf, offset - 1); \
367} \ 367} \
368static ssize_t show_auto_temp_##offset##_max (struct device *dev, char *buf) \ 368static ssize_t show_auto_temp_##offset##_max (struct device *dev, struct device_attribute *attr, char *buf) \
369{ \ 369{ \
370 return show_auto_temp_max(dev, buf, offset - 1); \ 370 return show_auto_temp_max(dev, buf, offset - 1); \
371} \ 371} \
372static ssize_t set_auto_temp_##offset##_min (struct device *dev, \ 372static ssize_t set_auto_temp_##offset##_min (struct device *dev, struct device_attribute *attr, \
373 const char *buf, size_t count) \ 373 const char *buf, size_t count) \
374{ \ 374{ \
375 return set_auto_temp_min(dev, buf, count, offset - 1); \ 375 return set_auto_temp_min(dev, buf, count, offset - 1); \
376} \ 376} \
377static ssize_t set_auto_temp_##offset##_max (struct device *dev, \ 377static ssize_t set_auto_temp_##offset##_max (struct device *dev, struct device_attribute *attr, \
378 const char *buf, size_t count) \ 378 const char *buf, size_t count) \
379{ \ 379{ \
380 return set_auto_temp_max(dev, buf, count, offset - 1); \ 380 return set_auto_temp_max(dev, buf, count, offset - 1); \
@@ -421,11 +421,11 @@ set_pwm(struct device *dev, const char *buf, size_t count, int nr)
421} 421}
422 422
423#define pwm_reg(offset) \ 423#define pwm_reg(offset) \
424static ssize_t show_pwm_##offset (struct device *dev, char *buf) \ 424static ssize_t show_pwm_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
425{ \ 425{ \
426 return show_pwm(dev, buf, offset - 1); \ 426 return show_pwm(dev, buf, offset - 1); \
427} \ 427} \
428static ssize_t set_pwm_##offset (struct device *dev, \ 428static ssize_t set_pwm_##offset (struct device *dev, struct device_attribute *attr, \
429 const char *buf, size_t count) \ 429 const char *buf, size_t count) \
430{ \ 430{ \
431 return set_pwm(dev, buf, count, offset - 1); \ 431 return set_pwm(dev, buf, count, offset - 1); \
@@ -440,7 +440,7 @@ pwm_reg(2);
440 440
441/* 441/*
442 * That function checks the cases where the fan reading is not 442 * That function checks the cases where the fan reading is not
443 * relevent. It is used to provide 0 as fan reading when the fan is 443 * relevant. It is used to provide 0 as fan reading when the fan is
444 * not supposed to run 444 * not supposed to run
445 */ 445 */
446static int trust_fan_readings(struct adm1031_data *data, int chan) 446static int trust_fan_readings(struct adm1031_data *data, int chan)
@@ -557,24 +557,24 @@ set_fan_div(struct device *dev, const char *buf, size_t count, int nr)
557} 557}
558 558
559#define fan_offset(offset) \ 559#define fan_offset(offset) \
560static ssize_t show_fan_##offset (struct device *dev, char *buf) \ 560static ssize_t show_fan_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
561{ \ 561{ \
562 return show_fan(dev, buf, offset - 1); \ 562 return show_fan(dev, buf, offset - 1); \
563} \ 563} \
564static ssize_t show_fan_##offset##_min (struct device *dev, char *buf) \ 564static ssize_t show_fan_##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \
565{ \ 565{ \
566 return show_fan_min(dev, buf, offset - 1); \ 566 return show_fan_min(dev, buf, offset - 1); \
567} \ 567} \
568static ssize_t show_fan_##offset##_div (struct device *dev, char *buf) \ 568static ssize_t show_fan_##offset##_div (struct device *dev, struct device_attribute *attr, char *buf) \
569{ \ 569{ \
570 return show_fan_div(dev, buf, offset - 1); \ 570 return show_fan_div(dev, buf, offset - 1); \
571} \ 571} \
572static ssize_t set_fan_##offset##_min (struct device *dev, \ 572static ssize_t set_fan_##offset##_min (struct device *dev, struct device_attribute *attr, \
573 const char *buf, size_t count) \ 573 const char *buf, size_t count) \
574{ \ 574{ \
575 return set_fan_min(dev, buf, count, offset - 1); \ 575 return set_fan_min(dev, buf, count, offset - 1); \
576} \ 576} \
577static ssize_t set_fan_##offset##_div (struct device *dev, \ 577static ssize_t set_fan_##offset##_div (struct device *dev, struct device_attribute *attr, \
578 const char *buf, size_t count) \ 578 const char *buf, size_t count) \
579{ \ 579{ \
580 return set_fan_div(dev, buf, count, offset - 1); \ 580 return set_fan_div(dev, buf, count, offset - 1); \
@@ -667,33 +667,33 @@ set_temp_crit(struct device *dev, const char *buf, size_t count, int nr)
667} 667}
668 668
669#define temp_reg(offset) \ 669#define temp_reg(offset) \
670static ssize_t show_temp_##offset (struct device *dev, char *buf) \ 670static ssize_t show_temp_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
671{ \ 671{ \
672 return show_temp(dev, buf, offset - 1); \ 672 return show_temp(dev, buf, offset - 1); \
673} \ 673} \
674static ssize_t show_temp_##offset##_min (struct device *dev, char *buf) \ 674static ssize_t show_temp_##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \
675{ \ 675{ \
676 return show_temp_min(dev, buf, offset - 1); \ 676 return show_temp_min(dev, buf, offset - 1); \
677} \ 677} \
678static ssize_t show_temp_##offset##_max (struct device *dev, char *buf) \ 678static ssize_t show_temp_##offset##_max (struct device *dev, struct device_attribute *attr, char *buf) \
679{ \ 679{ \
680 return show_temp_max(dev, buf, offset - 1); \ 680 return show_temp_max(dev, buf, offset - 1); \
681} \ 681} \
682static ssize_t show_temp_##offset##_crit (struct device *dev, char *buf) \ 682static ssize_t show_temp_##offset##_crit (struct device *dev, struct device_attribute *attr, char *buf) \
683{ \ 683{ \
684 return show_temp_crit(dev, buf, offset - 1); \ 684 return show_temp_crit(dev, buf, offset - 1); \
685} \ 685} \
686static ssize_t set_temp_##offset##_min (struct device *dev, \ 686static ssize_t set_temp_##offset##_min (struct device *dev, struct device_attribute *attr, \
687 const char *buf, size_t count) \ 687 const char *buf, size_t count) \
688{ \ 688{ \
689 return set_temp_min(dev, buf, count, offset - 1); \ 689 return set_temp_min(dev, buf, count, offset - 1); \
690} \ 690} \
691static ssize_t set_temp_##offset##_max (struct device *dev, \ 691static ssize_t set_temp_##offset##_max (struct device *dev, struct device_attribute *attr, \
692 const char *buf, size_t count) \ 692 const char *buf, size_t count) \
693{ \ 693{ \
694 return set_temp_max(dev, buf, count, offset - 1); \ 694 return set_temp_max(dev, buf, count, offset - 1); \
695} \ 695} \
696static ssize_t set_temp_##offset##_crit (struct device *dev, \ 696static ssize_t set_temp_##offset##_crit (struct device *dev, struct device_attribute *attr, \
697 const char *buf, size_t count) \ 697 const char *buf, size_t count) \
698{ \ 698{ \
699 return set_temp_crit(dev, buf, count, offset - 1); \ 699 return set_temp_crit(dev, buf, count, offset - 1); \
@@ -712,7 +712,7 @@ temp_reg(2);
712temp_reg(3); 712temp_reg(3);
713 713
714/* Alarms */ 714/* Alarms */
715static ssize_t show_alarms(struct device *dev, char *buf) 715static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf)
716{ 716{
717 struct adm1031_data *data = adm1031_update_device(dev); 717 struct adm1031_data *data = adm1031_update_device(dev);
718 return sprintf(buf, "%d\n", data->alarm); 718 return sprintf(buf, "%d\n", data->alarm);