aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/chips
diff options
context:
space:
mode:
authorYani Ioannou <yani.ioannou@gmail.com>2005-05-17 06:42:25 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-06-20 18:15:33 -0400
commita5099cfc2e82240b0a3e72ad79a5969d5af1a7dc (patch)
treeaca3273e927a4d65f8f5fdf4cf5d8283969a3b43 /drivers/i2c/chips
parent8627f9ba531269d8850919c62af1b017438e2e79 (diff)
[PATCH] Driver Core: drivers/i2c/chips/pc87360.c - w83627hf.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')
-rw-r--r--drivers/i2c/chips/pc87360.c68
-rw-r--r--drivers/i2c/chips/pcf8574.c6
-rw-r--r--drivers/i2c/chips/pcf8591.c10
-rw-r--r--drivers/i2c/chips/sis5595.c34
-rw-r--r--drivers/i2c/chips/smsc47b397.c4
-rw-r--r--drivers/i2c/chips/smsc47m1.c20
-rw-r--r--drivers/i2c/chips/via686a.c32
-rw-r--r--drivers/i2c/chips/w83627hf.c56
8 files changed, 115 insertions, 115 deletions
diff --git a/drivers/i2c/chips/pc87360.c b/drivers/i2c/chips/pc87360.c
index 6d94c36c9218..65637b2cd170 100644
--- a/drivers/i2c/chips/pc87360.c
+++ b/drivers/i2c/chips/pc87360.c
@@ -282,31 +282,31 @@ static ssize_t set_fan_min(struct device *dev, const char *buf,
282} 282}
283 283
284#define show_and_set_fan(offset) \ 284#define show_and_set_fan(offset) \
285static ssize_t show_fan##offset##_input(struct device *dev, char *buf) \ 285static ssize_t show_fan##offset##_input(struct device *dev, struct device_attribute *attr, char *buf) \
286{ \ 286{ \
287 struct pc87360_data *data = pc87360_update_device(dev); \ 287 struct pc87360_data *data = pc87360_update_device(dev); \
288 return sprintf(buf, "%u\n", FAN_FROM_REG(data->fan[offset-1], \ 288 return sprintf(buf, "%u\n", FAN_FROM_REG(data->fan[offset-1], \
289 FAN_DIV_FROM_REG(data->fan_status[offset-1]))); \ 289 FAN_DIV_FROM_REG(data->fan_status[offset-1]))); \
290} \ 290} \
291static ssize_t show_fan##offset##_min(struct device *dev, char *buf) \ 291static ssize_t show_fan##offset##_min(struct device *dev, struct device_attribute *attr, char *buf) \
292{ \ 292{ \
293 struct pc87360_data *data = pc87360_update_device(dev); \ 293 struct pc87360_data *data = pc87360_update_device(dev); \
294 return sprintf(buf, "%u\n", FAN_FROM_REG(data->fan_min[offset-1], \ 294 return sprintf(buf, "%u\n", FAN_FROM_REG(data->fan_min[offset-1], \
295 FAN_DIV_FROM_REG(data->fan_status[offset-1]))); \ 295 FAN_DIV_FROM_REG(data->fan_status[offset-1]))); \
296} \ 296} \
297static ssize_t show_fan##offset##_div(struct device *dev, char *buf) \ 297static ssize_t show_fan##offset##_div(struct device *dev, struct device_attribute *attr, char *buf) \
298{ \ 298{ \
299 struct pc87360_data *data = pc87360_update_device(dev); \ 299 struct pc87360_data *data = pc87360_update_device(dev); \
300 return sprintf(buf, "%u\n", \ 300 return sprintf(buf, "%u\n", \
301 FAN_DIV_FROM_REG(data->fan_status[offset-1])); \ 301 FAN_DIV_FROM_REG(data->fan_status[offset-1])); \
302} \ 302} \
303static ssize_t show_fan##offset##_status(struct device *dev, char *buf) \ 303static ssize_t show_fan##offset##_status(struct device *dev, struct device_attribute *attr, char *buf) \
304{ \ 304{ \
305 struct pc87360_data *data = pc87360_update_device(dev); \ 305 struct pc87360_data *data = pc87360_update_device(dev); \
306 return sprintf(buf, "%u\n", \ 306 return sprintf(buf, "%u\n", \
307 FAN_STATUS_FROM_REG(data->fan_status[offset-1])); \ 307 FAN_STATUS_FROM_REG(data->fan_status[offset-1])); \
308} \ 308} \
309static ssize_t set_fan##offset##_min(struct device *dev, const char *buf, \ 309static ssize_t set_fan##offset##_min(struct device *dev, struct device_attribute *attr, const char *buf, \
310 size_t count) \ 310 size_t count) \
311{ \ 311{ \
312 return set_fan_min(dev, buf, count, offset-1); \ 312 return set_fan_min(dev, buf, count, offset-1); \
@@ -324,7 +324,7 @@ show_and_set_fan(2)
324show_and_set_fan(3) 324show_and_set_fan(3)
325 325
326#define show_and_set_pwm(offset) \ 326#define show_and_set_pwm(offset) \
327static ssize_t show_pwm##offset(struct device *dev, char *buf) \ 327static ssize_t show_pwm##offset(struct device *dev, struct device_attribute *attr, char *buf) \
328{ \ 328{ \
329 struct pc87360_data *data = pc87360_update_device(dev); \ 329 struct pc87360_data *data = pc87360_update_device(dev); \
330 return sprintf(buf, "%u\n", \ 330 return sprintf(buf, "%u\n", \
@@ -332,7 +332,7 @@ static ssize_t show_pwm##offset(struct device *dev, char *buf) \
332 FAN_CONFIG_INVERT(data->fan_conf, \ 332 FAN_CONFIG_INVERT(data->fan_conf, \
333 offset-1))); \ 333 offset-1))); \
334} \ 334} \
335static ssize_t set_pwm##offset(struct device *dev, const char *buf, \ 335static ssize_t set_pwm##offset(struct device *dev, struct device_attribute *attr, const char *buf, \
336 size_t count) \ 336 size_t count) \
337{ \ 337{ \
338 struct i2c_client *client = to_i2c_client(dev); \ 338 struct i2c_client *client = to_i2c_client(dev); \
@@ -354,30 +354,30 @@ show_and_set_pwm(2)
354show_and_set_pwm(3) 354show_and_set_pwm(3)
355 355
356#define show_and_set_in(offset) \ 356#define show_and_set_in(offset) \
357static ssize_t show_in##offset##_input(struct device *dev, char *buf) \ 357static ssize_t show_in##offset##_input(struct device *dev, struct device_attribute *attr, char *buf) \
358{ \ 358{ \
359 struct pc87360_data *data = pc87360_update_device(dev); \ 359 struct pc87360_data *data = pc87360_update_device(dev); \
360 return sprintf(buf, "%u\n", IN_FROM_REG(data->in[offset], \ 360 return sprintf(buf, "%u\n", IN_FROM_REG(data->in[offset], \
361 data->in_vref)); \ 361 data->in_vref)); \
362} \ 362} \
363static ssize_t show_in##offset##_min(struct device *dev, char *buf) \ 363static ssize_t show_in##offset##_min(struct device *dev, struct device_attribute *attr, char *buf) \
364{ \ 364{ \
365 struct pc87360_data *data = pc87360_update_device(dev); \ 365 struct pc87360_data *data = pc87360_update_device(dev); \
366 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_min[offset], \ 366 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_min[offset], \
367 data->in_vref)); \ 367 data->in_vref)); \
368} \ 368} \
369static ssize_t show_in##offset##_max(struct device *dev, char *buf) \ 369static ssize_t show_in##offset##_max(struct device *dev, struct device_attribute *attr, char *buf) \
370{ \ 370{ \
371 struct pc87360_data *data = pc87360_update_device(dev); \ 371 struct pc87360_data *data = pc87360_update_device(dev); \
372 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_max[offset], \ 372 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_max[offset], \
373 data->in_vref)); \ 373 data->in_vref)); \
374} \ 374} \
375static ssize_t show_in##offset##_status(struct device *dev, char *buf) \ 375static ssize_t show_in##offset##_status(struct device *dev, struct device_attribute *attr, char *buf) \
376{ \ 376{ \
377 struct pc87360_data *data = pc87360_update_device(dev); \ 377 struct pc87360_data *data = pc87360_update_device(dev); \
378 return sprintf(buf, "%u\n", data->in_status[offset]); \ 378 return sprintf(buf, "%u\n", data->in_status[offset]); \
379} \ 379} \
380static ssize_t set_in##offset##_min(struct device *dev, const char *buf, \ 380static ssize_t set_in##offset##_min(struct device *dev, struct device_attribute *attr, const char *buf, \
381 size_t count) \ 381 size_t count) \
382{ \ 382{ \
383 struct i2c_client *client = to_i2c_client(dev); \ 383 struct i2c_client *client = to_i2c_client(dev); \
@@ -391,7 +391,7 @@ static ssize_t set_in##offset##_min(struct device *dev, const char *buf, \
391 up(&data->update_lock); \ 391 up(&data->update_lock); \
392 return count; \ 392 return count; \
393} \ 393} \
394static ssize_t set_in##offset##_max(struct device *dev, const char *buf, \ 394static ssize_t set_in##offset##_max(struct device *dev, struct device_attribute *attr, const char *buf, \
395 size_t count) \ 395 size_t count) \
396{ \ 396{ \
397 struct i2c_client *client = to_i2c_client(dev); \ 397 struct i2c_client *client = to_i2c_client(dev); \
@@ -427,36 +427,36 @@ show_and_set_in(9)
427show_and_set_in(10) 427show_and_set_in(10)
428 428
429#define show_and_set_therm(offset) \ 429#define show_and_set_therm(offset) \
430static ssize_t show_temp##offset##_input(struct device *dev, char *buf) \ 430static ssize_t show_temp##offset##_input(struct device *dev, struct device_attribute *attr, char *buf) \
431{ \ 431{ \
432 struct pc87360_data *data = pc87360_update_device(dev); \ 432 struct pc87360_data *data = pc87360_update_device(dev); \
433 return sprintf(buf, "%u\n", IN_FROM_REG(data->in[offset+7], \ 433 return sprintf(buf, "%u\n", IN_FROM_REG(data->in[offset+7], \
434 data->in_vref)); \ 434 data->in_vref)); \
435} \ 435} \
436static ssize_t show_temp##offset##_min(struct device *dev, char *buf) \ 436static ssize_t show_temp##offset##_min(struct device *dev, struct device_attribute *attr, char *buf) \
437{ \ 437{ \
438 struct pc87360_data *data = pc87360_update_device(dev); \ 438 struct pc87360_data *data = pc87360_update_device(dev); \
439 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_min[offset+7], \ 439 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_min[offset+7], \
440 data->in_vref)); \ 440 data->in_vref)); \
441} \ 441} \
442static ssize_t show_temp##offset##_max(struct device *dev, char *buf) \ 442static ssize_t show_temp##offset##_max(struct device *dev, struct device_attribute *attr, char *buf) \
443{ \ 443{ \
444 struct pc87360_data *data = pc87360_update_device(dev); \ 444 struct pc87360_data *data = pc87360_update_device(dev); \
445 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_max[offset+7], \ 445 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_max[offset+7], \
446 data->in_vref)); \ 446 data->in_vref)); \
447} \ 447} \
448static ssize_t show_temp##offset##_crit(struct device *dev, char *buf) \ 448static ssize_t show_temp##offset##_crit(struct device *dev, struct device_attribute *attr, char *buf) \
449{ \ 449{ \
450 struct pc87360_data *data = pc87360_update_device(dev); \ 450 struct pc87360_data *data = pc87360_update_device(dev); \
451 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_crit[offset-4], \ 451 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_crit[offset-4], \
452 data->in_vref)); \ 452 data->in_vref)); \
453} \ 453} \
454static ssize_t show_temp##offset##_status(struct device *dev, char *buf) \ 454static ssize_t show_temp##offset##_status(struct device *dev, struct device_attribute *attr, char *buf) \
455{ \ 455{ \
456 struct pc87360_data *data = pc87360_update_device(dev); \ 456 struct pc87360_data *data = pc87360_update_device(dev); \
457 return sprintf(buf, "%u\n", data->in_status[offset+7]); \ 457 return sprintf(buf, "%u\n", data->in_status[offset+7]); \
458} \ 458} \
459static ssize_t set_temp##offset##_min(struct device *dev, const char *buf, \ 459static ssize_t set_temp##offset##_min(struct device *dev, struct device_attribute *attr, const char *buf, \
460 size_t count) \ 460 size_t count) \
461{ \ 461{ \
462 struct i2c_client *client = to_i2c_client(dev); \ 462 struct i2c_client *client = to_i2c_client(dev); \
@@ -470,7 +470,7 @@ static ssize_t set_temp##offset##_min(struct device *dev, const char *buf, \
470 up(&data->update_lock); \ 470 up(&data->update_lock); \
471 return count; \ 471 return count; \
472} \ 472} \
473static ssize_t set_temp##offset##_max(struct device *dev, const char *buf, \ 473static ssize_t set_temp##offset##_max(struct device *dev, struct device_attribute *attr, const char *buf, \
474 size_t count) \ 474 size_t count) \
475{ \ 475{ \
476 struct i2c_client *client = to_i2c_client(dev); \ 476 struct i2c_client *client = to_i2c_client(dev); \
@@ -484,7 +484,7 @@ static ssize_t set_temp##offset##_max(struct device *dev, const char *buf, \
484 up(&data->update_lock); \ 484 up(&data->update_lock); \
485 return count; \ 485 return count; \
486} \ 486} \
487static ssize_t set_temp##offset##_crit(struct device *dev, const char *buf, \ 487static ssize_t set_temp##offset##_crit(struct device *dev, struct device_attribute *attr, const char *buf, \
488 size_t count) \ 488 size_t count) \
489{ \ 489{ \
490 struct i2c_client *client = to_i2c_client(dev); \ 490 struct i2c_client *client = to_i2c_client(dev); \
@@ -512,19 +512,19 @@ show_and_set_therm(4)
512show_and_set_therm(5) 512show_and_set_therm(5)
513show_and_set_therm(6) 513show_and_set_therm(6)
514 514
515static ssize_t show_vid(struct device *dev, char *buf) 515static ssize_t show_vid(struct device *dev, struct device_attribute *attr, char *buf)
516{ 516{
517 struct pc87360_data *data = pc87360_update_device(dev); 517 struct pc87360_data *data = pc87360_update_device(dev);
518 return sprintf(buf, "%u\n", vid_from_reg(data->vid, data->vrm)); 518 return sprintf(buf, "%u\n", vid_from_reg(data->vid, data->vrm));
519} 519}
520static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid, NULL); 520static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid, NULL);
521 521
522static ssize_t show_vrm(struct device *dev, char *buf) 522static ssize_t show_vrm(struct device *dev, struct device_attribute *attr, char *buf)
523{ 523{
524 struct pc87360_data *data = pc87360_update_device(dev); 524 struct pc87360_data *data = pc87360_update_device(dev);
525 return sprintf(buf, "%u\n", data->vrm); 525 return sprintf(buf, "%u\n", data->vrm);
526} 526}
527static ssize_t set_vrm(struct device *dev, const char *buf, size_t count) 527static ssize_t set_vrm(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
528{ 528{
529 struct i2c_client *client = to_i2c_client(dev); 529 struct i2c_client *client = to_i2c_client(dev);
530 struct pc87360_data *data = i2c_get_clientdata(client); 530 struct pc87360_data *data = i2c_get_clientdata(client);
@@ -533,7 +533,7 @@ static ssize_t set_vrm(struct device *dev, const char *buf, size_t count)
533} 533}
534static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm, set_vrm); 534static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm, set_vrm);
535 535
536static ssize_t show_in_alarms(struct device *dev, char *buf) 536static ssize_t show_in_alarms(struct device *dev, struct device_attribute *attr, char *buf)
537{ 537{
538 struct pc87360_data *data = pc87360_update_device(dev); 538 struct pc87360_data *data = pc87360_update_device(dev);
539 return sprintf(buf, "%u\n", data->in_alarms); 539 return sprintf(buf, "%u\n", data->in_alarms);
@@ -541,32 +541,32 @@ static ssize_t show_in_alarms(struct device *dev, char *buf)
541static DEVICE_ATTR(alarms_in, S_IRUGO, show_in_alarms, NULL); 541static DEVICE_ATTR(alarms_in, S_IRUGO, show_in_alarms, NULL);
542 542
543#define show_and_set_temp(offset) \ 543#define show_and_set_temp(offset) \
544static ssize_t show_temp##offset##_input(struct device *dev, char *buf) \ 544static ssize_t show_temp##offset##_input(struct device *dev, struct device_attribute *attr, char *buf) \
545{ \ 545{ \
546 struct pc87360_data *data = pc87360_update_device(dev); \ 546 struct pc87360_data *data = pc87360_update_device(dev); \
547 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp[offset-1])); \ 547 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp[offset-1])); \
548} \ 548} \
549static ssize_t show_temp##offset##_min(struct device *dev, char *buf) \ 549static ssize_t show_temp##offset##_min(struct device *dev, struct device_attribute *attr, char *buf) \
550{ \ 550{ \
551 struct pc87360_data *data = pc87360_update_device(dev); \ 551 struct pc87360_data *data = pc87360_update_device(dev); \
552 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_min[offset-1])); \ 552 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_min[offset-1])); \
553} \ 553} \
554static ssize_t show_temp##offset##_max(struct device *dev, char *buf) \ 554static ssize_t show_temp##offset##_max(struct device *dev, struct device_attribute *attr, char *buf) \
555{ \ 555{ \
556 struct pc87360_data *data = pc87360_update_device(dev); \ 556 struct pc87360_data *data = pc87360_update_device(dev); \
557 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_max[offset-1])); \ 557 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_max[offset-1])); \
558}\ 558}\
559static ssize_t show_temp##offset##_crit(struct device *dev, char *buf) \ 559static ssize_t show_temp##offset##_crit(struct device *dev, struct device_attribute *attr, char *buf) \
560{ \ 560{ \
561 struct pc87360_data *data = pc87360_update_device(dev); \ 561 struct pc87360_data *data = pc87360_update_device(dev); \
562 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_crit[offset-1])); \ 562 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_crit[offset-1])); \
563}\ 563}\
564static ssize_t show_temp##offset##_status(struct device *dev, char *buf) \ 564static ssize_t show_temp##offset##_status(struct device *dev, struct device_attribute *attr, char *buf) \
565{ \ 565{ \
566 struct pc87360_data *data = pc87360_update_device(dev); \ 566 struct pc87360_data *data = pc87360_update_device(dev); \
567 return sprintf(buf, "%d\n", data->temp_status[offset-1]); \ 567 return sprintf(buf, "%d\n", data->temp_status[offset-1]); \
568}\ 568}\
569static ssize_t set_temp##offset##_min(struct device *dev, const char *buf, \ 569static ssize_t set_temp##offset##_min(struct device *dev, struct device_attribute *attr, const char *buf, \
570 size_t count) \ 570 size_t count) \
571{ \ 571{ \
572 struct i2c_client *client = to_i2c_client(dev); \ 572 struct i2c_client *client = to_i2c_client(dev); \
@@ -580,7 +580,7 @@ static ssize_t set_temp##offset##_min(struct device *dev, const char *buf, \
580 up(&data->update_lock); \ 580 up(&data->update_lock); \
581 return count; \ 581 return count; \
582} \ 582} \
583static ssize_t set_temp##offset##_max(struct device *dev, const char *buf, \ 583static ssize_t set_temp##offset##_max(struct device *dev, struct device_attribute *attr, const char *buf, \
584 size_t count) \ 584 size_t count) \
585{ \ 585{ \
586 struct i2c_client *client = to_i2c_client(dev); \ 586 struct i2c_client *client = to_i2c_client(dev); \
@@ -594,7 +594,7 @@ static ssize_t set_temp##offset##_max(struct device *dev, const char *buf, \
594 up(&data->update_lock); \ 594 up(&data->update_lock); \
595 return count; \ 595 return count; \
596} \ 596} \
597static ssize_t set_temp##offset##_crit(struct device *dev, const char *buf, \ 597static ssize_t set_temp##offset##_crit(struct device *dev, struct device_attribute *attr, const char *buf, \
598 size_t count) \ 598 size_t count) \
599{ \ 599{ \
600 struct i2c_client *client = to_i2c_client(dev); \ 600 struct i2c_client *client = to_i2c_client(dev); \
@@ -622,7 +622,7 @@ show_and_set_temp(1)
622show_and_set_temp(2) 622show_and_set_temp(2)
623show_and_set_temp(3) 623show_and_set_temp(3)
624 624
625static ssize_t show_temp_alarms(struct device *dev, char *buf) 625static ssize_t show_temp_alarms(struct device *dev, struct device_attribute *attr, char *buf)
626{ 626{
627 struct pc87360_data *data = pc87360_update_device(dev); 627 struct pc87360_data *data = pc87360_update_device(dev);
628 return sprintf(buf, "%u\n", data->temp_alarms); 628 return sprintf(buf, "%u\n", data->temp_alarms);
diff --git a/drivers/i2c/chips/pcf8574.c b/drivers/i2c/chips/pcf8574.c
index 48b4e22eaffe..4956e9effd75 100644
--- a/drivers/i2c/chips/pcf8574.c
+++ b/drivers/i2c/chips/pcf8574.c
@@ -76,7 +76,7 @@ static struct i2c_driver pcf8574_driver = {
76}; 76};
77 77
78/* following are the sysfs callback functions */ 78/* following are the sysfs callback functions */
79static ssize_t show_read(struct device *dev, char *buf) 79static ssize_t show_read(struct device *dev, struct device_attribute *attr, char *buf)
80{ 80{
81 struct i2c_client *client = to_i2c_client(dev); 81 struct i2c_client *client = to_i2c_client(dev);
82 struct pcf8574_data *data = i2c_get_clientdata(client); 82 struct pcf8574_data *data = i2c_get_clientdata(client);
@@ -86,13 +86,13 @@ static ssize_t show_read(struct device *dev, char *buf)
86 86
87static DEVICE_ATTR(read, S_IRUGO, show_read, NULL); 87static DEVICE_ATTR(read, S_IRUGO, show_read, NULL);
88 88
89static ssize_t show_write(struct device *dev, char *buf) 89static ssize_t show_write(struct device *dev, struct device_attribute *attr, char *buf)
90{ 90{
91 struct pcf8574_data *data = i2c_get_clientdata(to_i2c_client(dev)); 91 struct pcf8574_data *data = i2c_get_clientdata(to_i2c_client(dev));
92 return sprintf(buf, "%u\n", data->write); 92 return sprintf(buf, "%u\n", data->write);
93} 93}
94 94
95static ssize_t set_write(struct device *dev, const char *buf, 95static ssize_t set_write(struct device *dev, struct device_attribute *attr, const char *buf,
96 size_t count) 96 size_t count)
97{ 97{
98 struct i2c_client *client = to_i2c_client(dev); 98 struct i2c_client *client = to_i2c_client(dev);
diff --git a/drivers/i2c/chips/pcf8591.c b/drivers/i2c/chips/pcf8591.c
index b6b927d8b372..db812ade8564 100644
--- a/drivers/i2c/chips/pcf8591.c
+++ b/drivers/i2c/chips/pcf8591.c
@@ -100,7 +100,7 @@ static struct i2c_driver pcf8591_driver = {
100 100
101/* following are the sysfs callback functions */ 101/* following are the sysfs callback functions */
102#define show_in_channel(channel) \ 102#define show_in_channel(channel) \
103static ssize_t show_in##channel##_input(struct device *dev, char *buf) \ 103static ssize_t show_in##channel##_input(struct device *dev, struct device_attribute *attr, char *buf) \
104{ \ 104{ \
105 return sprintf(buf, "%d\n", pcf8591_read_channel(dev, channel));\ 105 return sprintf(buf, "%d\n", pcf8591_read_channel(dev, channel));\
106} \ 106} \
@@ -112,13 +112,13 @@ show_in_channel(1);
112show_in_channel(2); 112show_in_channel(2);
113show_in_channel(3); 113show_in_channel(3);
114 114
115static ssize_t show_out0_ouput(struct device *dev, char *buf) 115static ssize_t show_out0_ouput(struct device *dev, struct device_attribute *attr, char *buf)
116{ 116{
117 struct pcf8591_data *data = i2c_get_clientdata(to_i2c_client(dev)); 117 struct pcf8591_data *data = i2c_get_clientdata(to_i2c_client(dev));
118 return sprintf(buf, "%d\n", data->aout * 10); 118 return sprintf(buf, "%d\n", data->aout * 10);
119} 119}
120 120
121static ssize_t set_out0_output(struct device *dev, const char *buf, size_t count) 121static ssize_t set_out0_output(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
122{ 122{
123 unsigned int value; 123 unsigned int value;
124 struct i2c_client *client = to_i2c_client(dev); 124 struct i2c_client *client = to_i2c_client(dev);
@@ -134,13 +134,13 @@ static ssize_t set_out0_output(struct device *dev, const char *buf, size_t count
134static DEVICE_ATTR(out0_output, S_IWUSR | S_IRUGO, 134static DEVICE_ATTR(out0_output, S_IWUSR | S_IRUGO,
135 show_out0_ouput, set_out0_output); 135 show_out0_ouput, set_out0_output);
136 136
137static ssize_t show_out0_enable(struct device *dev, char *buf) 137static ssize_t show_out0_enable(struct device *dev, struct device_attribute *attr, char *buf)
138{ 138{
139 struct pcf8591_data *data = i2c_get_clientdata(to_i2c_client(dev)); 139 struct pcf8591_data *data = i2c_get_clientdata(to_i2c_client(dev));
140 return sprintf(buf, "%u\n", !(!(data->control & PCF8591_CONTROL_AOEF))); 140 return sprintf(buf, "%u\n", !(!(data->control & PCF8591_CONTROL_AOEF)));
141} 141}
142 142
143static ssize_t set_out0_enable(struct device *dev, const char *buf, size_t count) 143static ssize_t set_out0_enable(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
144{ 144{
145 struct i2c_client *client = to_i2c_client(dev); 145 struct i2c_client *client = to_i2c_client(dev);
146 struct pcf8591_data *data = i2c_get_clientdata(client); 146 struct pcf8591_data *data = i2c_get_clientdata(client);
diff --git a/drivers/i2c/chips/sis5595.c b/drivers/i2c/chips/sis5595.c
index 7ea84532df32..c6650727a27d 100644
--- a/drivers/i2c/chips/sis5595.c
+++ b/drivers/i2c/chips/sis5595.c
@@ -256,28 +256,28 @@ static ssize_t set_in_max(struct device *dev, const char *buf,
256 256
257#define show_in_offset(offset) \ 257#define show_in_offset(offset) \
258static ssize_t \ 258static ssize_t \
259 show_in##offset (struct device *dev, char *buf) \ 259 show_in##offset (struct device *dev, struct device_attribute *attr, char *buf) \
260{ \ 260{ \
261 return show_in(dev, buf, offset); \ 261 return show_in(dev, buf, offset); \
262} \ 262} \
263static DEVICE_ATTR(in##offset##_input, S_IRUGO, \ 263static DEVICE_ATTR(in##offset##_input, S_IRUGO, \
264 show_in##offset, NULL); \ 264 show_in##offset, NULL); \
265static ssize_t \ 265static ssize_t \
266 show_in##offset##_min (struct device *dev, char *buf) \ 266 show_in##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \
267{ \ 267{ \
268 return show_in_min(dev, buf, offset); \ 268 return show_in_min(dev, buf, offset); \
269} \ 269} \
270static ssize_t \ 270static ssize_t \
271 show_in##offset##_max (struct device *dev, char *buf) \ 271 show_in##offset##_max (struct device *dev, struct device_attribute *attr, char *buf) \
272{ \ 272{ \
273 return show_in_max(dev, buf, offset); \ 273 return show_in_max(dev, buf, offset); \
274} \ 274} \
275static ssize_t set_in##offset##_min (struct device *dev, \ 275static ssize_t set_in##offset##_min (struct device *dev, struct device_attribute *attr, \
276 const char *buf, size_t count) \ 276 const char *buf, size_t count) \
277{ \ 277{ \
278 return set_in_min(dev, buf, count, offset); \ 278 return set_in_min(dev, buf, count, offset); \
279} \ 279} \
280static ssize_t set_in##offset##_max (struct device *dev, \ 280static ssize_t set_in##offset##_max (struct device *dev, struct device_attribute *attr, \
281 const char *buf, size_t count) \ 281 const char *buf, size_t count) \
282{ \ 282{ \
283 return set_in_max(dev, buf, count, offset); \ 283 return set_in_max(dev, buf, count, offset); \
@@ -294,19 +294,19 @@ show_in_offset(3);
294show_in_offset(4); 294show_in_offset(4);
295 295
296/* Temperature */ 296/* Temperature */
297static ssize_t show_temp(struct device *dev, char *buf) 297static ssize_t show_temp(struct device *dev, struct device_attribute *attr, char *buf)
298{ 298{
299 struct sis5595_data *data = sis5595_update_device(dev); 299 struct sis5595_data *data = sis5595_update_device(dev);
300 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp)); 300 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp));
301} 301}
302 302
303static ssize_t show_temp_over(struct device *dev, char *buf) 303static ssize_t show_temp_over(struct device *dev, struct device_attribute *attr, char *buf)
304{ 304{
305 struct sis5595_data *data = sis5595_update_device(dev); 305 struct sis5595_data *data = sis5595_update_device(dev);
306 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_over)); 306 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_over));
307} 307}
308 308
309static ssize_t set_temp_over(struct device *dev, const char *buf, size_t count) 309static ssize_t set_temp_over(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
310{ 310{
311 struct i2c_client *client = to_i2c_client(dev); 311 struct i2c_client *client = to_i2c_client(dev);
312 struct sis5595_data *data = i2c_get_clientdata(client); 312 struct sis5595_data *data = i2c_get_clientdata(client);
@@ -319,13 +319,13 @@ static ssize_t set_temp_over(struct device *dev, const char *buf, size_t count)
319 return count; 319 return count;
320} 320}
321 321
322static ssize_t show_temp_hyst(struct device *dev, char *buf) 322static ssize_t show_temp_hyst(struct device *dev, struct device_attribute *attr, char *buf)
323{ 323{
324 struct sis5595_data *data = sis5595_update_device(dev); 324 struct sis5595_data *data = sis5595_update_device(dev);
325 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_hyst)); 325 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_hyst));
326} 326}
327 327
328static ssize_t set_temp_hyst(struct device *dev, const char *buf, size_t count) 328static ssize_t set_temp_hyst(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
329{ 329{
330 struct i2c_client *client = to_i2c_client(dev); 330 struct i2c_client *client = to_i2c_client(dev);
331 struct sis5595_data *data = i2c_get_clientdata(client); 331 struct sis5595_data *data = i2c_get_clientdata(client);
@@ -426,19 +426,19 @@ static ssize_t set_fan_div(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 show_fan_##offset##_div (struct device *dev, char *buf) \ 437static ssize_t show_fan_##offset##_div (struct device *dev, struct device_attribute *attr, char *buf) \
438{ \ 438{ \
439 return show_fan_div(dev, buf, offset - 1); \ 439 return show_fan_div(dev, buf, offset - 1); \
440} \ 440} \
441static ssize_t set_fan_##offset##_min (struct device *dev, \ 441static ssize_t set_fan_##offset##_min (struct device *dev, struct device_attribute *attr, \
442 const char *buf, size_t count) \ 442 const char *buf, size_t count) \
443{ \ 443{ \
444 return set_fan_min(dev, buf, count, offset - 1); \ 444 return set_fan_min(dev, buf, count, offset - 1); \
@@ -450,13 +450,13 @@ static DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR, \
450show_fan_offset(1); 450show_fan_offset(1);
451show_fan_offset(2); 451show_fan_offset(2);
452 452
453static ssize_t set_fan_1_div(struct device *dev, const char *buf, 453static ssize_t set_fan_1_div(struct device *dev, struct device_attribute *attr, const char *buf,
454 size_t count) 454 size_t count)
455{ 455{
456 return set_fan_div(dev, buf, count, 0) ; 456 return set_fan_div(dev, buf, count, 0) ;
457} 457}
458 458
459static ssize_t set_fan_2_div(struct device *dev, const char *buf, 459static ssize_t set_fan_2_div(struct device *dev, struct device_attribute *attr, const char *buf,
460 size_t count) 460 size_t count)
461{ 461{
462 return set_fan_div(dev, buf, count, 1) ; 462 return set_fan_div(dev, buf, count, 1) ;
@@ -467,7 +467,7 @@ static DEVICE_ATTR(fan2_div, S_IRUGO | S_IWUSR,
467 show_fan_2_div, set_fan_2_div); 467 show_fan_2_div, set_fan_2_div);
468 468
469/* Alarms */ 469/* Alarms */
470static ssize_t show_alarms(struct device *dev, char *buf) 470static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf)
471{ 471{
472 struct sis5595_data *data = sis5595_update_device(dev); 472 struct sis5595_data *data = sis5595_update_device(dev);
473 return sprintf(buf, "%d\n", data->alarms); 473 return sprintf(buf, "%d\n", data->alarms);
diff --git a/drivers/i2c/chips/smsc47b397.c b/drivers/i2c/chips/smsc47b397.c
index 1119c76791d9..251ac2659554 100644
--- a/drivers/i2c/chips/smsc47b397.c
+++ b/drivers/i2c/chips/smsc47b397.c
@@ -172,7 +172,7 @@ static ssize_t show_temp(struct device *dev, char *buf, int nr)
172} 172}
173 173
174#define sysfs_temp(num) \ 174#define sysfs_temp(num) \
175static ssize_t show_temp##num(struct device *dev, char *buf) \ 175static ssize_t show_temp##num(struct device *dev, struct device_attribute *attr, char *buf) \
176{ \ 176{ \
177 return show_temp(dev, buf, num-1); \ 177 return show_temp(dev, buf, num-1); \
178} \ 178} \
@@ -201,7 +201,7 @@ static ssize_t show_fan(struct device *dev, char *buf, int nr)
201} 201}
202 202
203#define sysfs_fan(num) \ 203#define sysfs_fan(num) \
204static ssize_t show_fan##num(struct device *dev, char *buf) \ 204static ssize_t show_fan##num(struct device *dev, struct device_attribute *attr, char *buf) \
205{ \ 205{ \
206 return show_fan(dev, buf, num-1); \ 206 return show_fan(dev, buf, num-1); \
207} \ 207} \
diff --git a/drivers/i2c/chips/smsc47m1.c b/drivers/i2c/chips/smsc47m1.c
index 0e12ca369413..13d6d4a8bc7d 100644
--- a/drivers/i2c/chips/smsc47m1.c
+++ b/drivers/i2c/chips/smsc47m1.c
@@ -184,7 +184,7 @@ static ssize_t get_pwm_en(struct device *dev, char *buf, int nr)
184 return sprintf(buf, "%d\n", PWM_EN_FROM_REG(data->pwm[nr])); 184 return sprintf(buf, "%d\n", PWM_EN_FROM_REG(data->pwm[nr]));
185} 185}
186 186
187static ssize_t get_alarms(struct device *dev, char *buf) 187static ssize_t get_alarms(struct device *dev, struct device_attribute *attr, char *buf)
188{ 188{
189 struct smsc47m1_data *data = smsc47m1_update_device(dev, 0); 189 struct smsc47m1_data *data = smsc47m1_update_device(dev, 0);
190 return sprintf(buf, "%d\n", data->alarms); 190 return sprintf(buf, "%d\n", data->alarms);
@@ -298,42 +298,42 @@ static ssize_t set_pwm_en(struct device *dev, const char *buf,
298} 298}
299 299
300#define fan_present(offset) \ 300#define fan_present(offset) \
301static ssize_t get_fan##offset (struct device *dev, char *buf) \ 301static ssize_t get_fan##offset (struct device *dev, struct device_attribute *attr, char *buf) \
302{ \ 302{ \
303 return get_fan(dev, buf, offset - 1); \ 303 return get_fan(dev, buf, offset - 1); \
304} \ 304} \
305static ssize_t get_fan##offset##_min (struct device *dev, char *buf) \ 305static ssize_t get_fan##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \
306{ \ 306{ \
307 return get_fan_min(dev, buf, offset - 1); \ 307 return get_fan_min(dev, buf, offset - 1); \
308} \ 308} \
309static ssize_t set_fan##offset##_min (struct device *dev, \ 309static ssize_t set_fan##offset##_min (struct device *dev, struct device_attribute *attr, \
310 const char *buf, size_t count) \ 310 const char *buf, size_t count) \
311{ \ 311{ \
312 return set_fan_min(dev, buf, count, offset - 1); \ 312 return set_fan_min(dev, buf, count, offset - 1); \
313} \ 313} \
314static ssize_t get_fan##offset##_div (struct device *dev, char *buf) \ 314static ssize_t get_fan##offset##_div (struct device *dev, struct device_attribute *attr, char *buf) \
315{ \ 315{ \
316 return get_fan_div(dev, buf, offset - 1); \ 316 return get_fan_div(dev, buf, offset - 1); \
317} \ 317} \
318static ssize_t set_fan##offset##_div (struct device *dev, \ 318static ssize_t set_fan##offset##_div (struct device *dev, struct device_attribute *attr, \
319 const char *buf, size_t count) \ 319 const char *buf, size_t count) \
320{ \ 320{ \
321 return set_fan_div(dev, buf, count, offset - 1); \ 321 return set_fan_div(dev, buf, count, offset - 1); \
322} \ 322} \
323static ssize_t get_pwm##offset (struct device *dev, char *buf) \ 323static ssize_t get_pwm##offset (struct device *dev, struct device_attribute *attr, char *buf) \
324{ \ 324{ \
325 return get_pwm(dev, buf, offset - 1); \ 325 return get_pwm(dev, buf, offset - 1); \
326} \ 326} \
327static ssize_t set_pwm##offset (struct device *dev, \ 327static ssize_t set_pwm##offset (struct device *dev, struct device_attribute *attr, \
328 const char *buf, size_t count) \ 328 const char *buf, size_t count) \
329{ \ 329{ \
330 return set_pwm(dev, buf, count, offset - 1); \ 330 return set_pwm(dev, buf, count, offset - 1); \
331} \ 331} \
332static ssize_t get_pwm##offset##_en (struct device *dev, char *buf) \ 332static ssize_t get_pwm##offset##_en (struct device *dev, struct device_attribute *attr, char *buf) \
333{ \ 333{ \
334 return get_pwm_en(dev, buf, offset - 1); \ 334 return get_pwm_en(dev, buf, offset - 1); \
335} \ 335} \
336static ssize_t set_pwm##offset##_en (struct device *dev, \ 336static ssize_t set_pwm##offset##_en (struct device *dev, struct device_attribute *attr, \
337 const char *buf, size_t count) \ 337 const char *buf, size_t count) \
338{ \ 338{ \
339 return set_pwm_en(dev, buf, count, offset - 1); \ 339 return set_pwm_en(dev, buf, count, offset - 1); \
diff --git a/drivers/i2c/chips/via686a.c b/drivers/i2c/chips/via686a.c
index 6614a59cecd4..fefc24a9251a 100644
--- a/drivers/i2c/chips/via686a.c
+++ b/drivers/i2c/chips/via686a.c
@@ -386,26 +386,26 @@ static ssize_t set_in_max(struct device *dev, const char *buf,
386} 386}
387#define show_in_offset(offset) \ 387#define show_in_offset(offset) \
388static ssize_t \ 388static ssize_t \
389 show_in##offset (struct device *dev, char *buf) \ 389 show_in##offset (struct device *dev, struct device_attribute *attr, char *buf) \
390{ \ 390{ \
391 return show_in(dev, buf, offset); \ 391 return show_in(dev, buf, offset); \
392} \ 392} \
393static ssize_t \ 393static ssize_t \
394 show_in##offset##_min (struct device *dev, char *buf) \ 394 show_in##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \
395{ \ 395{ \
396 return show_in_min(dev, buf, offset); \ 396 return show_in_min(dev, buf, offset); \
397} \ 397} \
398static ssize_t \ 398static ssize_t \
399 show_in##offset##_max (struct device *dev, char *buf) \ 399 show_in##offset##_max (struct device *dev, struct device_attribute *attr, char *buf) \
400{ \ 400{ \
401 return show_in_max(dev, buf, offset); \ 401 return show_in_max(dev, buf, offset); \
402} \ 402} \
403static ssize_t set_in##offset##_min (struct device *dev, \ 403static ssize_t set_in##offset##_min (struct device *dev, struct device_attribute *attr, \
404 const char *buf, size_t count) \ 404 const char *buf, size_t count) \
405{ \ 405{ \
406 return set_in_min(dev, buf, count, offset); \ 406 return set_in_min(dev, buf, count, offset); \
407} \ 407} \
408static ssize_t set_in##offset##_max (struct device *dev, \ 408static ssize_t set_in##offset##_max (struct device *dev, struct device_attribute *attr, \
409 const char *buf, size_t count) \ 409 const char *buf, size_t count) \
410{ \ 410{ \
411 return set_in_max(dev, buf, count, offset); \ 411 return set_in_max(dev, buf, count, offset); \
@@ -460,26 +460,26 @@ static ssize_t set_temp_hyst(struct device *dev, const char *buf,
460 return count; 460 return count;
461} 461}
462#define show_temp_offset(offset) \ 462#define show_temp_offset(offset) \
463static ssize_t show_temp_##offset (struct device *dev, char *buf) \ 463static ssize_t show_temp_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
464{ \ 464{ \
465 return show_temp(dev, buf, offset - 1); \ 465 return show_temp(dev, buf, offset - 1); \
466} \ 466} \
467static ssize_t \ 467static ssize_t \
468show_temp_##offset##_over (struct device *dev, char *buf) \ 468show_temp_##offset##_over (struct device *dev, struct device_attribute *attr, char *buf) \
469{ \ 469{ \
470 return show_temp_over(dev, buf, offset - 1); \ 470 return show_temp_over(dev, buf, offset - 1); \
471} \ 471} \
472static ssize_t \ 472static ssize_t \
473show_temp_##offset##_hyst (struct device *dev, char *buf) \ 473show_temp_##offset##_hyst (struct device *dev, struct device_attribute *attr, char *buf) \
474{ \ 474{ \
475 return show_temp_hyst(dev, buf, offset - 1); \ 475 return show_temp_hyst(dev, buf, offset - 1); \
476} \ 476} \
477static ssize_t set_temp_##offset##_over (struct device *dev, \ 477static ssize_t set_temp_##offset##_over (struct device *dev, struct device_attribute *attr, \
478 const char *buf, size_t count) \ 478 const char *buf, size_t count) \
479{ \ 479{ \
480 return set_temp_over(dev, buf, count, offset - 1); \ 480 return set_temp_over(dev, buf, count, offset - 1); \
481} \ 481} \
482static ssize_t set_temp_##offset##_hyst (struct device *dev, \ 482static ssize_t set_temp_##offset##_hyst (struct device *dev, struct device_attribute *attr, \
483 const char *buf, size_t count) \ 483 const char *buf, size_t count) \
484{ \ 484{ \
485 return set_temp_hyst(dev, buf, count, offset - 1); \ 485 return set_temp_hyst(dev, buf, count, offset - 1); \
@@ -538,24 +538,24 @@ static ssize_t set_fan_div(struct device *dev, const char *buf,
538} 538}
539 539
540#define show_fan_offset(offset) \ 540#define show_fan_offset(offset) \
541static ssize_t show_fan_##offset (struct device *dev, char *buf) \ 541static ssize_t show_fan_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
542{ \ 542{ \
543 return show_fan(dev, buf, offset - 1); \ 543 return show_fan(dev, buf, offset - 1); \
544} \ 544} \
545static ssize_t show_fan_##offset##_min (struct device *dev, char *buf) \ 545static ssize_t show_fan_##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \
546{ \ 546{ \
547 return show_fan_min(dev, buf, offset - 1); \ 547 return show_fan_min(dev, buf, offset - 1); \
548} \ 548} \
549static ssize_t show_fan_##offset##_div (struct device *dev, char *buf) \ 549static ssize_t show_fan_##offset##_div (struct device *dev, struct device_attribute *attr, char *buf) \
550{ \ 550{ \
551 return show_fan_div(dev, buf, offset - 1); \ 551 return show_fan_div(dev, buf, offset - 1); \
552} \ 552} \
553static ssize_t set_fan_##offset##_min (struct device *dev, \ 553static ssize_t set_fan_##offset##_min (struct device *dev, struct device_attribute *attr, \
554 const char *buf, size_t count) \ 554 const char *buf, size_t count) \
555{ \ 555{ \
556 return set_fan_min(dev, buf, count, offset - 1); \ 556 return set_fan_min(dev, buf, count, offset - 1); \
557} \ 557} \
558static ssize_t set_fan_##offset##_div (struct device *dev, \ 558static ssize_t set_fan_##offset##_div (struct device *dev, struct device_attribute *attr, \
559 const char *buf, size_t count) \ 559 const char *buf, size_t count) \
560{ \ 560{ \
561 return set_fan_div(dev, buf, count, offset - 1); \ 561 return set_fan_div(dev, buf, count, offset - 1); \
@@ -570,7 +570,7 @@ show_fan_offset(1);
570show_fan_offset(2); 570show_fan_offset(2);
571 571
572/* Alarms */ 572/* Alarms */
573static ssize_t show_alarms(struct device *dev, char *buf) { 573static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf) {
574 struct via686a_data *data = via686a_update_device(dev); 574 struct via686a_data *data = via686a_update_device(dev);
575 return sprintf(buf,"%d\n", ALARMS_FROM_REG(data->alarms)); 575 return sprintf(buf,"%d\n", ALARMS_FROM_REG(data->alarms));
576} 576}
diff --git a/drivers/i2c/chips/w83627hf.c b/drivers/i2c/chips/w83627hf.c
index b1da5ed696d3..4f1bff572c1c 100644
--- a/drivers/i2c/chips/w83627hf.c
+++ b/drivers/i2c/chips/w83627hf.c
@@ -368,19 +368,19 @@ store_in_reg(MAX, max)
368 368
369#define sysfs_in_offset(offset) \ 369#define sysfs_in_offset(offset) \
370static ssize_t \ 370static ssize_t \
371show_regs_in_##offset (struct device *dev, char *buf) \ 371show_regs_in_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
372{ \ 372{ \
373 return show_in(dev, buf, offset); \ 373 return show_in(dev, buf, offset); \
374} \ 374} \
375static DEVICE_ATTR(in##offset##_input, S_IRUGO, show_regs_in_##offset, NULL); 375static DEVICE_ATTR(in##offset##_input, S_IRUGO, show_regs_in_##offset, NULL);
376 376
377#define sysfs_in_reg_offset(reg, offset) \ 377#define sysfs_in_reg_offset(reg, offset) \
378static ssize_t show_regs_in_##reg##offset (struct device *dev, char *buf) \ 378static ssize_t show_regs_in_##reg##offset (struct device *dev, struct device_attribute *attr, char *buf) \
379{ \ 379{ \
380 return show_in_##reg (dev, buf, offset); \ 380 return show_in_##reg (dev, buf, offset); \
381} \ 381} \
382static ssize_t \ 382static ssize_t \
383store_regs_in_##reg##offset (struct device *dev, \ 383store_regs_in_##reg##offset (struct device *dev, struct device_attribute *attr, \
384 const char *buf, size_t count) \ 384 const char *buf, size_t count) \
385{ \ 385{ \
386 return store_in_##reg (dev, buf, count, offset); \ 386 return store_in_##reg (dev, buf, count, offset); \
@@ -419,25 +419,25 @@ static ssize_t show_in_0(struct w83627hf_data *data, char *buf, u8 reg)
419 return sprintf(buf,"%ld\n", in0); 419 return sprintf(buf,"%ld\n", in0);
420} 420}
421 421
422static ssize_t show_regs_in_0(struct device *dev, char *buf) 422static ssize_t show_regs_in_0(struct device *dev, struct device_attribute *attr, char *buf)
423{ 423{
424 struct w83627hf_data *data = w83627hf_update_device(dev); 424 struct w83627hf_data *data = w83627hf_update_device(dev);
425 return show_in_0(data, buf, data->in[0]); 425 return show_in_0(data, buf, data->in[0]);
426} 426}
427 427
428static ssize_t show_regs_in_min0(struct device *dev, char *buf) 428static ssize_t show_regs_in_min0(struct device *dev, struct device_attribute *attr, char *buf)
429{ 429{
430 struct w83627hf_data *data = w83627hf_update_device(dev); 430 struct w83627hf_data *data = w83627hf_update_device(dev);
431 return show_in_0(data, buf, data->in_min[0]); 431 return show_in_0(data, buf, data->in_min[0]);
432} 432}
433 433
434static ssize_t show_regs_in_max0(struct device *dev, char *buf) 434static ssize_t show_regs_in_max0(struct device *dev, struct device_attribute *attr, char *buf)
435{ 435{
436 struct w83627hf_data *data = w83627hf_update_device(dev); 436 struct w83627hf_data *data = w83627hf_update_device(dev);
437 return show_in_0(data, buf, data->in_max[0]); 437 return show_in_0(data, buf, data->in_max[0]);
438} 438}
439 439
440static ssize_t store_regs_in_min0(struct device *dev, 440static ssize_t store_regs_in_min0(struct device *dev, struct device_attribute *attr,
441 const char *buf, size_t count) 441 const char *buf, size_t count)
442{ 442{
443 struct i2c_client *client = to_i2c_client(dev); 443 struct i2c_client *client = to_i2c_client(dev);
@@ -462,7 +462,7 @@ static ssize_t store_regs_in_min0(struct device *dev,
462 return count; 462 return count;
463} 463}
464 464
465static ssize_t store_regs_in_max0(struct device *dev, 465static ssize_t store_regs_in_max0(struct device *dev, struct device_attribute *attr,
466 const char *buf, size_t count) 466 const char *buf, size_t count)
467{ 467{
468 struct i2c_client *client = to_i2c_client(dev); 468 struct i2c_client *client = to_i2c_client(dev);
@@ -531,19 +531,19 @@ store_fan_min(struct device *dev, const char *buf, size_t count, int nr)
531} 531}
532 532
533#define sysfs_fan_offset(offset) \ 533#define sysfs_fan_offset(offset) \
534static ssize_t show_regs_fan_##offset (struct device *dev, char *buf) \ 534static ssize_t show_regs_fan_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
535{ \ 535{ \
536 return show_fan(dev, buf, offset); \ 536 return show_fan(dev, buf, offset); \
537} \ 537} \
538static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_regs_fan_##offset, NULL); 538static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_regs_fan_##offset, NULL);
539 539
540#define sysfs_fan_min_offset(offset) \ 540#define sysfs_fan_min_offset(offset) \
541static ssize_t show_regs_fan_min##offset (struct device *dev, char *buf) \ 541static ssize_t show_regs_fan_min##offset (struct device *dev, struct device_attribute *attr, char *buf) \
542{ \ 542{ \
543 return show_fan_min(dev, buf, offset); \ 543 return show_fan_min(dev, buf, offset); \
544} \ 544} \
545static ssize_t \ 545static ssize_t \
546store_regs_fan_min##offset (struct device *dev, const char *buf, size_t count) \ 546store_regs_fan_min##offset (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \
547{ \ 547{ \
548 return store_fan_min(dev, buf, count, offset); \ 548 return store_fan_min(dev, buf, count, offset); \
549} \ 549} \
@@ -608,19 +608,19 @@ store_temp_reg(HYST, max_hyst);
608 608
609#define sysfs_temp_offset(offset) \ 609#define sysfs_temp_offset(offset) \
610static ssize_t \ 610static ssize_t \
611show_regs_temp_##offset (struct device *dev, char *buf) \ 611show_regs_temp_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
612{ \ 612{ \
613 return show_temp(dev, buf, offset); \ 613 return show_temp(dev, buf, offset); \
614} \ 614} \
615static DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_regs_temp_##offset, NULL); 615static DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_regs_temp_##offset, NULL);
616 616
617#define sysfs_temp_reg_offset(reg, offset) \ 617#define sysfs_temp_reg_offset(reg, offset) \
618static ssize_t show_regs_temp_##reg##offset (struct device *dev, char *buf) \ 618static ssize_t show_regs_temp_##reg##offset (struct device *dev, struct device_attribute *attr, char *buf) \
619{ \ 619{ \
620 return show_temp_##reg (dev, buf, offset); \ 620 return show_temp_##reg (dev, buf, offset); \
621} \ 621} \
622static ssize_t \ 622static ssize_t \
623store_regs_temp_##reg##offset (struct device *dev, \ 623store_regs_temp_##reg##offset (struct device *dev, struct device_attribute *attr, \
624 const char *buf, size_t count) \ 624 const char *buf, size_t count) \
625{ \ 625{ \
626 return store_temp_##reg (dev, buf, count, offset); \ 626 return store_temp_##reg (dev, buf, count, offset); \
@@ -645,7 +645,7 @@ device_create_file(&client->dev, &dev_attr_temp##offset##_max_hyst); \
645} while (0) 645} while (0)
646 646
647static ssize_t 647static ssize_t
648show_vid_reg(struct device *dev, char *buf) 648show_vid_reg(struct device *dev, struct device_attribute *attr, char *buf)
649{ 649{
650 struct w83627hf_data *data = w83627hf_update_device(dev); 650 struct w83627hf_data *data = w83627hf_update_device(dev);
651 return sprintf(buf, "%ld\n", (long) vid_from_reg(data->vid, data->vrm)); 651 return sprintf(buf, "%ld\n", (long) vid_from_reg(data->vid, data->vrm));
@@ -655,13 +655,13 @@ static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid_reg, NULL);
655device_create_file(&client->dev, &dev_attr_cpu0_vid) 655device_create_file(&client->dev, &dev_attr_cpu0_vid)
656 656
657static ssize_t 657static ssize_t
658show_vrm_reg(struct device *dev, char *buf) 658show_vrm_reg(struct device *dev, struct device_attribute *attr, char *buf)
659{ 659{
660 struct w83627hf_data *data = w83627hf_update_device(dev); 660 struct w83627hf_data *data = w83627hf_update_device(dev);
661 return sprintf(buf, "%ld\n", (long) data->vrm); 661 return sprintf(buf, "%ld\n", (long) data->vrm);
662} 662}
663static ssize_t 663static ssize_t
664store_vrm_reg(struct device *dev, const char *buf, size_t count) 664store_vrm_reg(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
665{ 665{
666 struct i2c_client *client = to_i2c_client(dev); 666 struct i2c_client *client = to_i2c_client(dev);
667 struct w83627hf_data *data = i2c_get_clientdata(client); 667 struct w83627hf_data *data = i2c_get_clientdata(client);
@@ -677,7 +677,7 @@ static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm_reg, store_vrm_reg);
677device_create_file(&client->dev, &dev_attr_vrm) 677device_create_file(&client->dev, &dev_attr_vrm)
678 678
679static ssize_t 679static ssize_t
680show_alarms_reg(struct device *dev, char *buf) 680show_alarms_reg(struct device *dev, struct device_attribute *attr, char *buf)
681{ 681{
682 struct w83627hf_data *data = w83627hf_update_device(dev); 682 struct w83627hf_data *data = w83627hf_update_device(dev);
683 return sprintf(buf, "%ld\n", (long) data->alarms); 683 return sprintf(buf, "%ld\n", (long) data->alarms);
@@ -687,7 +687,7 @@ static DEVICE_ATTR(alarms, S_IRUGO, show_alarms_reg, NULL);
687device_create_file(&client->dev, &dev_attr_alarms) 687device_create_file(&client->dev, &dev_attr_alarms)
688 688
689#define show_beep_reg(REG, reg) \ 689#define show_beep_reg(REG, reg) \
690static ssize_t show_beep_##reg (struct device *dev, char *buf) \ 690static ssize_t show_beep_##reg (struct device *dev, struct device_attribute *attr, char *buf) \
691{ \ 691{ \
692 struct w83627hf_data *data = w83627hf_update_device(dev); \ 692 struct w83627hf_data *data = w83627hf_update_device(dev); \
693 return sprintf(buf,"%ld\n", \ 693 return sprintf(buf,"%ld\n", \
@@ -732,12 +732,12 @@ store_beep_reg(struct device *dev, const char *buf, size_t count,
732} 732}
733 733
734#define sysfs_beep(REG, reg) \ 734#define sysfs_beep(REG, reg) \
735static ssize_t show_regs_beep_##reg (struct device *dev, char *buf) \ 735static ssize_t show_regs_beep_##reg (struct device *dev, struct device_attribute *attr, char *buf) \
736{ \ 736{ \
737 return show_beep_##reg(dev, buf); \ 737 return show_beep_##reg(dev, attr, buf); \
738} \ 738} \
739static ssize_t \ 739static ssize_t \
740store_regs_beep_##reg (struct device *dev, const char *buf, size_t count) \ 740store_regs_beep_##reg (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \
741{ \ 741{ \
742 return store_beep_reg(dev, buf, count, BEEP_##REG); \ 742 return store_beep_reg(dev, buf, count, BEEP_##REG); \
743} \ 743} \
@@ -801,12 +801,12 @@ store_fan_div_reg(struct device *dev, const char *buf, size_t count, int nr)
801} 801}
802 802
803#define sysfs_fan_div(offset) \ 803#define sysfs_fan_div(offset) \
804static ssize_t show_regs_fan_div_##offset (struct device *dev, char *buf) \ 804static ssize_t show_regs_fan_div_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
805{ \ 805{ \
806 return show_fan_div_reg(dev, buf, offset); \ 806 return show_fan_div_reg(dev, buf, offset); \
807} \ 807} \
808static ssize_t \ 808static ssize_t \
809store_regs_fan_div_##offset (struct device *dev, \ 809store_regs_fan_div_##offset (struct device *dev, struct device_attribute *attr, \
810 const char *buf, size_t count) \ 810 const char *buf, size_t count) \
811{ \ 811{ \
812 return store_fan_div_reg(dev, buf, count, offset - 1); \ 812 return store_fan_div_reg(dev, buf, count, offset - 1); \
@@ -861,12 +861,12 @@ store_pwm_reg(struct device *dev, const char *buf, size_t count, int nr)
861} 861}
862 862
863#define sysfs_pwm(offset) \ 863#define sysfs_pwm(offset) \
864static ssize_t show_regs_pwm_##offset (struct device *dev, char *buf) \ 864static ssize_t show_regs_pwm_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
865{ \ 865{ \
866 return show_pwm_reg(dev, buf, offset); \ 866 return show_pwm_reg(dev, buf, offset); \
867} \ 867} \
868static ssize_t \ 868static ssize_t \
869store_regs_pwm_##offset (struct device *dev, const char *buf, size_t count) \ 869store_regs_pwm_##offset (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \
870{ \ 870{ \
871 return store_pwm_reg(dev, buf, count, offset); \ 871 return store_pwm_reg(dev, buf, count, offset); \
872} \ 872} \
@@ -937,12 +937,12 @@ store_sensor_reg(struct device *dev, const char *buf, size_t count, int nr)
937} 937}
938 938
939#define sysfs_sensor(offset) \ 939#define sysfs_sensor(offset) \
940static ssize_t show_regs_sensor_##offset (struct device *dev, char *buf) \ 940static ssize_t show_regs_sensor_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
941{ \ 941{ \
942 return show_sensor_reg(dev, buf, offset); \ 942 return show_sensor_reg(dev, buf, offset); \
943} \ 943} \
944static ssize_t \ 944static ssize_t \
945store_regs_sensor_##offset (struct device *dev, const char *buf, size_t count) \ 945store_regs_sensor_##offset (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \
946{ \ 946{ \
947 return store_sensor_reg(dev, buf, count, offset); \ 947 return store_sensor_reg(dev, buf, count, offset); \
948} \ 948} \