diff options
Diffstat (limited to 'drivers/i2c/chips')
-rw-r--r-- | drivers/i2c/chips/w83781d.c | 52 | ||||
-rw-r--r-- | drivers/i2c/chips/w83l785ts.c | 4 |
2 files changed, 28 insertions, 28 deletions
diff --git a/drivers/i2c/chips/w83781d.c b/drivers/i2c/chips/w83781d.c index 4954e465c419..c3926d2d8ac6 100644 --- a/drivers/i2c/chips/w83781d.c +++ b/drivers/i2c/chips/w83781d.c | |||
@@ -309,18 +309,18 @@ store_in_reg(MAX, max); | |||
309 | 309 | ||
310 | #define sysfs_in_offset(offset) \ | 310 | #define sysfs_in_offset(offset) \ |
311 | static ssize_t \ | 311 | static ssize_t \ |
312 | show_regs_in_##offset (struct device *dev, char *buf) \ | 312 | show_regs_in_##offset (struct device *dev, struct device_attribute *attr, char *buf) \ |
313 | { \ | 313 | { \ |
314 | return show_in(dev, buf, offset); \ | 314 | return show_in(dev, buf, offset); \ |
315 | } \ | 315 | } \ |
316 | static DEVICE_ATTR(in##offset##_input, S_IRUGO, show_regs_in_##offset, NULL); | 316 | static DEVICE_ATTR(in##offset##_input, S_IRUGO, show_regs_in_##offset, NULL); |
317 | 317 | ||
318 | #define sysfs_in_reg_offset(reg, offset) \ | 318 | #define sysfs_in_reg_offset(reg, offset) \ |
319 | static ssize_t show_regs_in_##reg##offset (struct device *dev, char *buf) \ | 319 | static ssize_t show_regs_in_##reg##offset (struct device *dev, struct device_attribute *attr, char *buf) \ |
320 | { \ | 320 | { \ |
321 | return show_in_##reg (dev, buf, offset); \ | 321 | return show_in_##reg (dev, buf, offset); \ |
322 | } \ | 322 | } \ |
323 | static ssize_t store_regs_in_##reg##offset (struct device *dev, const char *buf, size_t count) \ | 323 | static ssize_t store_regs_in_##reg##offset (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \ |
324 | { \ | 324 | { \ |
325 | return store_in_##reg (dev, buf, count, offset); \ | 325 | return store_in_##reg (dev, buf, count, offset); \ |
326 | } \ | 326 | } \ |
@@ -378,18 +378,18 @@ store_fan_min(struct device *dev, const char *buf, size_t count, int nr) | |||
378 | } | 378 | } |
379 | 379 | ||
380 | #define sysfs_fan_offset(offset) \ | 380 | #define sysfs_fan_offset(offset) \ |
381 | static ssize_t show_regs_fan_##offset (struct device *dev, char *buf) \ | 381 | static ssize_t show_regs_fan_##offset (struct device *dev, struct device_attribute *attr, char *buf) \ |
382 | { \ | 382 | { \ |
383 | return show_fan(dev, buf, offset); \ | 383 | return show_fan(dev, buf, offset); \ |
384 | } \ | 384 | } \ |
385 | static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_regs_fan_##offset, NULL); | 385 | static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_regs_fan_##offset, NULL); |
386 | 386 | ||
387 | #define sysfs_fan_min_offset(offset) \ | 387 | #define sysfs_fan_min_offset(offset) \ |
388 | static ssize_t show_regs_fan_min##offset (struct device *dev, char *buf) \ | 388 | static ssize_t show_regs_fan_min##offset (struct device *dev, struct device_attribute *attr, char *buf) \ |
389 | { \ | 389 | { \ |
390 | return show_fan_min(dev, buf, offset); \ | 390 | return show_fan_min(dev, buf, offset); \ |
391 | } \ | 391 | } \ |
392 | static ssize_t store_regs_fan_min##offset (struct device *dev, const char *buf, size_t count) \ | 392 | static ssize_t store_regs_fan_min##offset (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \ |
393 | { \ | 393 | { \ |
394 | return store_fan_min(dev, buf, count, offset); \ | 394 | return store_fan_min(dev, buf, count, offset); \ |
395 | } \ | 395 | } \ |
@@ -452,18 +452,18 @@ store_temp_reg(HYST, max_hyst); | |||
452 | 452 | ||
453 | #define sysfs_temp_offset(offset) \ | 453 | #define sysfs_temp_offset(offset) \ |
454 | static ssize_t \ | 454 | static ssize_t \ |
455 | show_regs_temp_##offset (struct device *dev, char *buf) \ | 455 | show_regs_temp_##offset (struct device *dev, struct device_attribute *attr, char *buf) \ |
456 | { \ | 456 | { \ |
457 | return show_temp(dev, buf, offset); \ | 457 | return show_temp(dev, buf, offset); \ |
458 | } \ | 458 | } \ |
459 | static DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_regs_temp_##offset, NULL); | 459 | static DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_regs_temp_##offset, NULL); |
460 | 460 | ||
461 | #define sysfs_temp_reg_offset(reg, offset) \ | 461 | #define sysfs_temp_reg_offset(reg, offset) \ |
462 | static ssize_t show_regs_temp_##reg##offset (struct device *dev, char *buf) \ | 462 | static ssize_t show_regs_temp_##reg##offset (struct device *dev, struct device_attribute *attr, char *buf) \ |
463 | { \ | 463 | { \ |
464 | return show_temp_##reg (dev, buf, offset); \ | 464 | return show_temp_##reg (dev, buf, offset); \ |
465 | } \ | 465 | } \ |
466 | static ssize_t store_regs_temp_##reg##offset (struct device *dev, const char *buf, size_t count) \ | 466 | static ssize_t store_regs_temp_##reg##offset (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \ |
467 | { \ | 467 | { \ |
468 | return store_temp_##reg (dev, buf, count, offset); \ | 468 | return store_temp_##reg (dev, buf, count, offset); \ |
469 | } \ | 469 | } \ |
@@ -486,7 +486,7 @@ device_create_file(&client->dev, &dev_attr_temp##offset##_max_hyst); \ | |||
486 | } while (0) | 486 | } while (0) |
487 | 487 | ||
488 | static ssize_t | 488 | static ssize_t |
489 | show_vid_reg(struct device *dev, char *buf) | 489 | show_vid_reg(struct device *dev, struct device_attribute *attr, char *buf) |
490 | { | 490 | { |
491 | struct w83781d_data *data = w83781d_update_device(dev); | 491 | struct w83781d_data *data = w83781d_update_device(dev); |
492 | return sprintf(buf, "%ld\n", (long) vid_from_reg(data->vid, data->vrm)); | 492 | return sprintf(buf, "%ld\n", (long) vid_from_reg(data->vid, data->vrm)); |
@@ -497,14 +497,14 @@ DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid_reg, NULL); | |||
497 | #define device_create_file_vid(client) \ | 497 | #define device_create_file_vid(client) \ |
498 | device_create_file(&client->dev, &dev_attr_cpu0_vid); | 498 | device_create_file(&client->dev, &dev_attr_cpu0_vid); |
499 | static ssize_t | 499 | static ssize_t |
500 | show_vrm_reg(struct device *dev, char *buf) | 500 | show_vrm_reg(struct device *dev, struct device_attribute *attr, char *buf) |
501 | { | 501 | { |
502 | struct w83781d_data *data = w83781d_update_device(dev); | 502 | struct w83781d_data *data = w83781d_update_device(dev); |
503 | return sprintf(buf, "%ld\n", (long) data->vrm); | 503 | return sprintf(buf, "%ld\n", (long) data->vrm); |
504 | } | 504 | } |
505 | 505 | ||
506 | static ssize_t | 506 | static ssize_t |
507 | store_vrm_reg(struct device *dev, const char *buf, size_t count) | 507 | store_vrm_reg(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) |
508 | { | 508 | { |
509 | struct i2c_client *client = to_i2c_client(dev); | 509 | struct i2c_client *client = to_i2c_client(dev); |
510 | struct w83781d_data *data = i2c_get_clientdata(client); | 510 | struct w83781d_data *data = i2c_get_clientdata(client); |
@@ -521,7 +521,7 @@ DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm_reg, store_vrm_reg); | |||
521 | #define device_create_file_vrm(client) \ | 521 | #define device_create_file_vrm(client) \ |
522 | device_create_file(&client->dev, &dev_attr_vrm); | 522 | device_create_file(&client->dev, &dev_attr_vrm); |
523 | static ssize_t | 523 | static ssize_t |
524 | show_alarms_reg(struct device *dev, char *buf) | 524 | show_alarms_reg(struct device *dev, struct device_attribute *attr, char *buf) |
525 | { | 525 | { |
526 | struct w83781d_data *data = w83781d_update_device(dev); | 526 | struct w83781d_data *data = w83781d_update_device(dev); |
527 | return sprintf(buf, "%ld\n", (long) ALARMS_FROM_REG(data->alarms)); | 527 | return sprintf(buf, "%ld\n", (long) ALARMS_FROM_REG(data->alarms)); |
@@ -531,13 +531,13 @@ static | |||
531 | DEVICE_ATTR(alarms, S_IRUGO, show_alarms_reg, NULL); | 531 | DEVICE_ATTR(alarms, S_IRUGO, show_alarms_reg, NULL); |
532 | #define device_create_file_alarms(client) \ | 532 | #define device_create_file_alarms(client) \ |
533 | device_create_file(&client->dev, &dev_attr_alarms); | 533 | device_create_file(&client->dev, &dev_attr_alarms); |
534 | static ssize_t show_beep_mask (struct device *dev, char *buf) | 534 | static ssize_t show_beep_mask (struct device *dev, struct device_attribute *attr, char *buf) |
535 | { | 535 | { |
536 | struct w83781d_data *data = w83781d_update_device(dev); | 536 | struct w83781d_data *data = w83781d_update_device(dev); |
537 | return sprintf(buf, "%ld\n", | 537 | return sprintf(buf, "%ld\n", |
538 | (long)BEEP_MASK_FROM_REG(data->beep_mask, data->type)); | 538 | (long)BEEP_MASK_FROM_REG(data->beep_mask, data->type)); |
539 | } | 539 | } |
540 | static ssize_t show_beep_enable (struct device *dev, char *buf) | 540 | static ssize_t show_beep_enable (struct device *dev, struct device_attribute *attr, char *buf) |
541 | { | 541 | { |
542 | struct w83781d_data *data = w83781d_update_device(dev); | 542 | struct w83781d_data *data = w83781d_update_device(dev); |
543 | return sprintf(buf, "%ld\n", | 543 | return sprintf(buf, "%ld\n", |
@@ -583,11 +583,11 @@ store_beep_reg(struct device *dev, const char *buf, size_t count, | |||
583 | } | 583 | } |
584 | 584 | ||
585 | #define sysfs_beep(REG, reg) \ | 585 | #define sysfs_beep(REG, reg) \ |
586 | static ssize_t show_regs_beep_##reg (struct device *dev, char *buf) \ | 586 | static ssize_t show_regs_beep_##reg (struct device *dev, struct device_attribute *attr, char *buf) \ |
587 | { \ | 587 | { \ |
588 | return show_beep_##reg(dev, buf); \ | 588 | return show_beep_##reg(dev, attr, buf); \ |
589 | } \ | 589 | } \ |
590 | static ssize_t store_regs_beep_##reg (struct device *dev, const char *buf, size_t count) \ | 590 | static ssize_t store_regs_beep_##reg (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \ |
591 | { \ | 591 | { \ |
592 | return store_beep_reg(dev, buf, count, BEEP_##REG); \ | 592 | return store_beep_reg(dev, buf, count, BEEP_##REG); \ |
593 | } \ | 593 | } \ |
@@ -653,11 +653,11 @@ store_fan_div_reg(struct device *dev, const char *buf, size_t count, int nr) | |||
653 | } | 653 | } |
654 | 654 | ||
655 | #define sysfs_fan_div(offset) \ | 655 | #define sysfs_fan_div(offset) \ |
656 | static ssize_t show_regs_fan_div_##offset (struct device *dev, char *buf) \ | 656 | static ssize_t show_regs_fan_div_##offset (struct device *dev, struct device_attribute *attr, char *buf) \ |
657 | { \ | 657 | { \ |
658 | return show_fan_div_reg(dev, buf, offset); \ | 658 | return show_fan_div_reg(dev, buf, offset); \ |
659 | } \ | 659 | } \ |
660 | static ssize_t store_regs_fan_div_##offset (struct device *dev, const char *buf, size_t count) \ | 660 | static ssize_t store_regs_fan_div_##offset (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \ |
661 | { \ | 661 | { \ |
662 | return store_fan_div_reg(dev, buf, count, offset - 1); \ | 662 | return store_fan_div_reg(dev, buf, count, offset - 1); \ |
663 | } \ | 663 | } \ |
@@ -737,11 +737,11 @@ store_pwmenable_reg(struct device *dev, const char *buf, size_t count, int nr) | |||
737 | } | 737 | } |
738 | 738 | ||
739 | #define sysfs_pwm(offset) \ | 739 | #define sysfs_pwm(offset) \ |
740 | static ssize_t show_regs_pwm_##offset (struct device *dev, char *buf) \ | 740 | static ssize_t show_regs_pwm_##offset (struct device *dev, struct device_attribute *attr, char *buf) \ |
741 | { \ | 741 | { \ |
742 | return show_pwm_reg(dev, buf, offset); \ | 742 | return show_pwm_reg(dev, buf, offset); \ |
743 | } \ | 743 | } \ |
744 | static ssize_t store_regs_pwm_##offset (struct device *dev, \ | 744 | static ssize_t store_regs_pwm_##offset (struct device *dev, struct device_attribute *attr, \ |
745 | const char *buf, size_t count) \ | 745 | const char *buf, size_t count) \ |
746 | { \ | 746 | { \ |
747 | return store_pwm_reg(dev, buf, count, offset); \ | 747 | return store_pwm_reg(dev, buf, count, offset); \ |
@@ -750,11 +750,11 @@ static DEVICE_ATTR(pwm##offset, S_IRUGO | S_IWUSR, \ | |||
750 | show_regs_pwm_##offset, store_regs_pwm_##offset); | 750 | show_regs_pwm_##offset, store_regs_pwm_##offset); |
751 | 751 | ||
752 | #define sysfs_pwmenable(offset) \ | 752 | #define sysfs_pwmenable(offset) \ |
753 | static ssize_t show_regs_pwmenable_##offset (struct device *dev, char *buf) \ | 753 | static ssize_t show_regs_pwmenable_##offset (struct device *dev, struct device_attribute *attr, char *buf) \ |
754 | { \ | 754 | { \ |
755 | return show_pwmenable_reg(dev, buf, offset); \ | 755 | return show_pwmenable_reg(dev, buf, offset); \ |
756 | } \ | 756 | } \ |
757 | static ssize_t store_regs_pwmenable_##offset (struct device *dev, \ | 757 | static ssize_t store_regs_pwmenable_##offset (struct device *dev, struct device_attribute *attr, \ |
758 | const char *buf, size_t count) \ | 758 | const char *buf, size_t count) \ |
759 | { \ | 759 | { \ |
760 | return store_pwmenable_reg(dev, buf, count, offset); \ | 760 | return store_pwmenable_reg(dev, buf, count, offset); \ |
@@ -832,11 +832,11 @@ store_sensor_reg(struct device *dev, const char *buf, size_t count, int nr) | |||
832 | } | 832 | } |
833 | 833 | ||
834 | #define sysfs_sensor(offset) \ | 834 | #define sysfs_sensor(offset) \ |
835 | static ssize_t show_regs_sensor_##offset (struct device *dev, char *buf) \ | 835 | static ssize_t show_regs_sensor_##offset (struct device *dev, struct device_attribute *attr, char *buf) \ |
836 | { \ | 836 | { \ |
837 | return show_sensor_reg(dev, buf, offset); \ | 837 | return show_sensor_reg(dev, buf, offset); \ |
838 | } \ | 838 | } \ |
839 | static ssize_t store_regs_sensor_##offset (struct device *dev, const char *buf, size_t count) \ | 839 | static ssize_t store_regs_sensor_##offset (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \ |
840 | { \ | 840 | { \ |
841 | return store_sensor_reg(dev, buf, count, offset); \ | 841 | return store_sensor_reg(dev, buf, count, offset); \ |
842 | } \ | 842 | } \ |
diff --git a/drivers/i2c/chips/w83l785ts.c b/drivers/i2c/chips/w83l785ts.c index 59bbc5881fa6..74d4b58e4237 100644 --- a/drivers/i2c/chips/w83l785ts.c +++ b/drivers/i2c/chips/w83l785ts.c | |||
@@ -118,13 +118,13 @@ struct w83l785ts_data { | |||
118 | * Sysfs stuff | 118 | * Sysfs stuff |
119 | */ | 119 | */ |
120 | 120 | ||
121 | static ssize_t show_temp(struct device *dev, char *buf) | 121 | static ssize_t show_temp(struct device *dev, struct device_attribute *attr, char *buf) |
122 | { | 122 | { |
123 | struct w83l785ts_data *data = w83l785ts_update_device(dev); | 123 | struct w83l785ts_data *data = w83l785ts_update_device(dev); |
124 | return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp)); | 124 | return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp)); |
125 | } | 125 | } |
126 | 126 | ||
127 | static ssize_t show_temp_over(struct device *dev, char *buf) | 127 | static ssize_t show_temp_over(struct device *dev, struct device_attribute *attr, char *buf) |
128 | { | 128 | { |
129 | struct w83l785ts_data *data = w83l785ts_update_device(dev); | 129 | struct w83l785ts_data *data = w83l785ts_update_device(dev); |
130 | return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_over)); | 130 | return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_over)); |