aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/chips/w83627ehf.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2005-06-22 00:01:59 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-06-22 00:51:59 -0400
commit6f637a6494a1872c613fe68f64ea4831c3e5b037 (patch)
treea18368e908290ca7bdf3430b0b5b9cbc0131da5b /drivers/i2c/chips/w83627ehf.c
parent563db2fe9e0843da9d1d85d824f022be0ada4a3c (diff)
[PATCH] I2C: fix up some sysfs device attribute file parameters
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/i2c/chips/w83627ehf.c')
-rw-r--r--drivers/i2c/chips/w83627ehf.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/drivers/i2c/chips/w83627ehf.c b/drivers/i2c/chips/w83627ehf.c
index 4fcc823e89b5..8a40b6976e1a 100644
--- a/drivers/i2c/chips/w83627ehf.c
+++ b/drivers/i2c/chips/w83627ehf.c
@@ -486,7 +486,8 @@ store_fan_min(struct device *dev, const char *buf, size_t count, int nr)
486 486
487#define sysfs_fan_offset(offset) \ 487#define sysfs_fan_offset(offset) \
488static ssize_t \ 488static ssize_t \
489show_reg_fan_##offset(struct device *dev, char *buf) \ 489show_reg_fan_##offset(struct device *dev, struct device_attribute *attr, \
490 char *buf) \
490{ \ 491{ \
491 return show_fan(dev, buf, offset-1); \ 492 return show_fan(dev, buf, offset-1); \
492} \ 493} \
@@ -495,13 +496,14 @@ static DEVICE_ATTR(fan##offset##_input, S_IRUGO, \
495 496
496#define sysfs_fan_min_offset(offset) \ 497#define sysfs_fan_min_offset(offset) \
497static ssize_t \ 498static ssize_t \
498show_reg_fan##offset##_min(struct device *dev, char *buf) \ 499show_reg_fan##offset##_min(struct device *dev, struct device_attribute *attr, \
500 char *buf) \
499{ \ 501{ \
500 return show_fan_min(dev, buf, offset-1); \ 502 return show_fan_min(dev, buf, offset-1); \
501} \ 503} \
502static ssize_t \ 504static ssize_t \
503store_reg_fan##offset##_min(struct device *dev, const char *buf, \ 505store_reg_fan##offset##_min(struct device *dev, struct device_attribute *attr, \
504 size_t count) \ 506 const char *buf, size_t count) \
505{ \ 507{ \
506 return store_fan_min(dev, buf, count, offset-1); \ 508 return store_fan_min(dev, buf, count, offset-1); \
507} \ 509} \
@@ -511,7 +513,8 @@ static DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR, \
511 513
512#define sysfs_fan_div_offset(offset) \ 514#define sysfs_fan_div_offset(offset) \
513static ssize_t \ 515static ssize_t \
514show_reg_fan##offset##_div(struct device *dev, char *buf) \ 516show_reg_fan##offset##_div(struct device *dev, struct device_attribute *attr, \
517 char *buf) \
515{ \ 518{ \
516 return show_fan_div(dev, buf, offset - 1); \ 519 return show_fan_div(dev, buf, offset - 1); \
517} \ 520} \
@@ -536,7 +539,8 @@ sysfs_fan_div_offset(5);
536 539
537#define show_temp1_reg(reg) \ 540#define show_temp1_reg(reg) \
538static ssize_t \ 541static ssize_t \
539show_##reg(struct device *dev, char *buf) \ 542show_##reg(struct device *dev, struct device_attribute *attr, \
543 char *buf) \
540{ \ 544{ \
541 struct w83627ehf_data *data = w83627ehf_update_device(dev); \ 545 struct w83627ehf_data *data = w83627ehf_update_device(dev); \
542 return sprintf(buf, "%d\n", temp1_from_reg(data->reg)); \ 546 return sprintf(buf, "%d\n", temp1_from_reg(data->reg)); \
@@ -547,7 +551,8 @@ show_temp1_reg(temp1_max_hyst);
547 551
548#define store_temp1_reg(REG, reg) \ 552#define store_temp1_reg(REG, reg) \
549static ssize_t \ 553static ssize_t \
550store_temp1_##reg(struct device *dev, const char *buf, size_t count) \ 554store_temp1_##reg(struct device *dev, struct device_attribute *attr, \
555 const char *buf, size_t count) \
551{ \ 556{ \
552 struct i2c_client *client = to_i2c_client(dev); \ 557 struct i2c_client *client = to_i2c_client(dev); \
553 struct w83627ehf_data *data = i2c_get_clientdata(client); \ 558 struct w83627ehf_data *data = i2c_get_clientdata(client); \
@@ -601,7 +606,8 @@ store_temp_reg(HYST, temp_max_hyst);
601 606
602#define sysfs_temp_offset(offset) \ 607#define sysfs_temp_offset(offset) \
603static ssize_t \ 608static ssize_t \
604show_reg_temp##offset (struct device *dev, char *buf) \ 609show_reg_temp##offset (struct device *dev, struct device_attribute *attr, \
610 char *buf) \
605{ \ 611{ \
606 return show_temp(dev, buf, offset - 2); \ 612 return show_temp(dev, buf, offset - 2); \
607} \ 613} \
@@ -610,13 +616,14 @@ static DEVICE_ATTR(temp##offset##_input, S_IRUGO, \
610 616
611#define sysfs_temp_reg_offset(reg, offset) \ 617#define sysfs_temp_reg_offset(reg, offset) \
612static ssize_t \ 618static ssize_t \
613show_reg_temp##offset##_##reg(struct device *dev, char *buf) \ 619show_reg_temp##offset##_##reg(struct device *dev, struct device_attribute *attr, \
620 char *buf) \
614{ \ 621{ \
615 return show_temp_##reg(dev, buf, offset - 2); \ 622 return show_temp_##reg(dev, buf, offset - 2); \
616} \ 623} \
617static ssize_t \ 624static ssize_t \
618store_reg_temp##offset##_##reg(struct device *dev, const char *buf, \ 625store_reg_temp##offset##_##reg(struct device *dev, struct device_attribute *attr, \
619 size_t count) \ 626 const char *buf, size_t count) \
620{ \ 627{ \
621 return store_temp_##reg(dev, buf, count, offset - 2); \ 628 return store_temp_##reg(dev, buf, count, offset - 2); \
622} \ 629} \