aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
authorYani Ioannou <yani.ioannou@gmail.com>2005-05-17 06:42:58 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-06-20 18:15:34 -0400
commite404e274f62665f3333d6a539d0d3701f678a598 (patch)
treeef6618291524edaab45c4123274730c7d57ae852 /drivers/i2c
parenta5099cfc2e82240b0a3e72ad79a5969d5af1a7dc (diff)
[PATCH] Driver Core: drivers/i2c/chips/w83781d.c - drivers/s390/block/dcssblk.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')
-rw-r--r--drivers/i2c/chips/w83781d.c52
-rw-r--r--drivers/i2c/chips/w83l785ts.c4
-rw-r--r--drivers/i2c/i2c-core.c4
3 files changed, 30 insertions, 30 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) \
311static ssize_t \ 311static ssize_t \
312show_regs_in_##offset (struct device *dev, char *buf) \ 312show_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} \
316static DEVICE_ATTR(in##offset##_input, S_IRUGO, show_regs_in_##offset, NULL); 316static 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) \
319static ssize_t show_regs_in_##reg##offset (struct device *dev, char *buf) \ 319static 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} \
323static ssize_t store_regs_in_##reg##offset (struct device *dev, const char *buf, size_t count) \ 323static 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) \
381static ssize_t show_regs_fan_##offset (struct device *dev, char *buf) \ 381static 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} \
385static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_regs_fan_##offset, NULL); 385static 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) \
388static ssize_t show_regs_fan_min##offset (struct device *dev, char *buf) \ 388static 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} \
392static ssize_t store_regs_fan_min##offset (struct device *dev, const char *buf, size_t count) \ 392static 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) \
454static ssize_t \ 454static ssize_t \
455show_regs_temp_##offset (struct device *dev, char *buf) \ 455show_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} \
459static DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_regs_temp_##offset, NULL); 459static 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) \
462static ssize_t show_regs_temp_##reg##offset (struct device *dev, char *buf) \ 462static 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} \
466static ssize_t store_regs_temp_##reg##offset (struct device *dev, const char *buf, size_t count) \ 466static 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
488static ssize_t 488static ssize_t
489show_vid_reg(struct device *dev, char *buf) 489show_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) \
498device_create_file(&client->dev, &dev_attr_cpu0_vid); 498device_create_file(&client->dev, &dev_attr_cpu0_vid);
499static ssize_t 499static ssize_t
500show_vrm_reg(struct device *dev, char *buf) 500show_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
506static ssize_t 506static ssize_t
507store_vrm_reg(struct device *dev, const char *buf, size_t count) 507store_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) \
522device_create_file(&client->dev, &dev_attr_vrm); 522device_create_file(&client->dev, &dev_attr_vrm);
523static ssize_t 523static ssize_t
524show_alarms_reg(struct device *dev, char *buf) 524show_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
531DEVICE_ATTR(alarms, S_IRUGO, show_alarms_reg, NULL); 531DEVICE_ATTR(alarms, S_IRUGO, show_alarms_reg, NULL);
532#define device_create_file_alarms(client) \ 532#define device_create_file_alarms(client) \
533device_create_file(&client->dev, &dev_attr_alarms); 533device_create_file(&client->dev, &dev_attr_alarms);
534static ssize_t show_beep_mask (struct device *dev, char *buf) 534static 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}
540static ssize_t show_beep_enable (struct device *dev, char *buf) 540static 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) \
586static ssize_t show_regs_beep_##reg (struct device *dev, char *buf) \ 586static 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} \
590static ssize_t store_regs_beep_##reg (struct device *dev, const char *buf, size_t count) \ 590static 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) \
656static ssize_t show_regs_fan_div_##offset (struct device *dev, char *buf) \ 656static 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} \
660static ssize_t store_regs_fan_div_##offset (struct device *dev, const char *buf, size_t count) \ 660static 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) \
740static ssize_t show_regs_pwm_##offset (struct device *dev, char *buf) \ 740static 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} \
744static ssize_t store_regs_pwm_##offset (struct device *dev, \ 744static 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) \
753static ssize_t show_regs_pwmenable_##offset (struct device *dev, char *buf) \ 753static 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} \
757static ssize_t store_regs_pwmenable_##offset (struct device *dev, \ 757static 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) \
835static ssize_t show_regs_sensor_##offset (struct device *dev, char *buf) \ 835static 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} \
839static ssize_t store_regs_sensor_##offset (struct device *dev, const char *buf, size_t count) \ 839static 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
121static ssize_t show_temp(struct device *dev, char *buf) 121static 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
127static ssize_t show_temp_over(struct device *dev, char *buf) 127static 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));
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 9011627d7eb0..a22e53badacb 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -103,7 +103,7 @@ static struct class i2c_adapter_class = {
103 .release = &i2c_adapter_class_dev_release, 103 .release = &i2c_adapter_class_dev_release,
104}; 104};
105 105
106static ssize_t show_adapter_name(struct device *dev, char *buf) 106static ssize_t show_adapter_name(struct device *dev, struct device_attribute *attr, char *buf)
107{ 107{
108 struct i2c_adapter *adap = dev_to_i2c_adapter(dev); 108 struct i2c_adapter *adap = dev_to_i2c_adapter(dev);
109 return sprintf(buf, "%s\n", adap->name); 109 return sprintf(buf, "%s\n", adap->name);
@@ -117,7 +117,7 @@ static void i2c_client_release(struct device *dev)
117 complete(&client->released); 117 complete(&client->released);
118} 118}
119 119
120static ssize_t show_client_name(struct device *dev, char *buf) 120static ssize_t show_client_name(struct device *dev, struct device_attribute *attr, char *buf)
121{ 121{
122 struct i2c_client *client = to_i2c_client(dev); 122 struct i2c_client *client = to_i2c_client(dev);
123 return sprintf(buf, "%s\n", client->name); 123 return sprintf(buf, "%s\n", client->name);