diff options
-rw-r--r-- | drivers/i2c/chips/adm1031.c | 44 | ||||
-rw-r--r-- | drivers/i2c/chips/asb100.c | 46 | ||||
-rw-r--r-- | drivers/i2c/chips/ds1621.c | 6 | ||||
-rw-r--r-- | drivers/i2c/chips/fscher.c | 8 | ||||
-rw-r--r-- | drivers/i2c/chips/fscpos.c | 16 | ||||
-rw-r--r-- | drivers/i2c/chips/gl518sm.c | 12 | ||||
-rw-r--r-- | drivers/i2c/chips/gl520sm.c | 8 | ||||
-rw-r--r-- | drivers/i2c/chips/it87.c | 50 | ||||
-rw-r--r-- | drivers/i2c/chips/lm63.c | 24 | ||||
-rw-r--r-- | drivers/i2c/chips/lm75.c | 4 |
10 files changed, 109 insertions, 109 deletions
diff --git a/drivers/i2c/chips/adm1031.c b/drivers/i2c/chips/adm1031.c index d4385a23f79a..2163dba467c4 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) \ |
295 | static ssize_t show_fan_auto_channel_##offset (struct device *dev, char *buf) \ | 295 | static 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 | } \ |
299 | static ssize_t set_fan_auto_channel_##offset (struct device *dev, \ | 299 | static 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) \ |
360 | static ssize_t show_auto_temp_##offset##_off (struct device *dev, char *buf) \ | 360 | static 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 | } \ |
364 | static ssize_t show_auto_temp_##offset##_min (struct device *dev, char *buf) \ | 364 | static 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 | } \ |
368 | static ssize_t show_auto_temp_##offset##_max (struct device *dev, char *buf) \ | 368 | static 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 | } \ |
372 | static ssize_t set_auto_temp_##offset##_min (struct device *dev, \ | 372 | static 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 | } \ |
377 | static ssize_t set_auto_temp_##offset##_max (struct device *dev, \ | 377 | static 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) \ |
424 | static ssize_t show_pwm_##offset (struct device *dev, char *buf) \ | 424 | static 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 | } \ |
428 | static ssize_t set_pwm_##offset (struct device *dev, \ | 428 | static 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); \ |
@@ -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) \ |
560 | static ssize_t show_fan_##offset (struct device *dev, char *buf) \ | 560 | static 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 | } \ |
564 | static ssize_t show_fan_##offset##_min (struct device *dev, char *buf) \ | 564 | static 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 | } \ |
568 | static ssize_t show_fan_##offset##_div (struct device *dev, char *buf) \ | 568 | static 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 | } \ |
572 | static ssize_t set_fan_##offset##_min (struct device *dev, \ | 572 | static 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 | } \ |
577 | static ssize_t set_fan_##offset##_div (struct device *dev, \ | 577 | static 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) \ |
670 | static ssize_t show_temp_##offset (struct device *dev, char *buf) \ | 670 | static 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 | } \ |
674 | static ssize_t show_temp_##offset##_min (struct device *dev, char *buf) \ | 674 | static 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 | } \ |
678 | static ssize_t show_temp_##offset##_max (struct device *dev, char *buf) \ | 678 | static 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 | } \ |
682 | static ssize_t show_temp_##offset##_crit (struct device *dev, char *buf) \ | 682 | static 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 | } \ |
686 | static ssize_t set_temp_##offset##_min (struct device *dev, \ | 686 | static 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 | } \ |
691 | static ssize_t set_temp_##offset##_max (struct device *dev, \ | 691 | static 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 | } \ |
696 | static ssize_t set_temp_##offset##_crit (struct device *dev, \ | 696 | static 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); | |||
712 | temp_reg(3); | 712 | temp_reg(3); |
713 | 713 | ||
714 | /* Alarms */ | 714 | /* Alarms */ |
715 | static ssize_t show_alarms(struct device *dev, char *buf) | 715 | static 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); |
diff --git a/drivers/i2c/chips/asb100.c b/drivers/i2c/chips/asb100.c index 7f899002bc54..4a47b4493e34 100644 --- a/drivers/i2c/chips/asb100.c +++ b/drivers/i2c/chips/asb100.c | |||
@@ -260,28 +260,28 @@ set_in_reg(MAX, max) | |||
260 | 260 | ||
261 | #define sysfs_in(offset) \ | 261 | #define sysfs_in(offset) \ |
262 | static ssize_t \ | 262 | static ssize_t \ |
263 | show_in##offset (struct device *dev, char *buf) \ | 263 | show_in##offset (struct device *dev, struct device_attribute *attr, char *buf) \ |
264 | { \ | 264 | { \ |
265 | return show_in(dev, buf, offset); \ | 265 | return show_in(dev, buf, offset); \ |
266 | } \ | 266 | } \ |
267 | static DEVICE_ATTR(in##offset##_input, S_IRUGO, \ | 267 | static DEVICE_ATTR(in##offset##_input, S_IRUGO, \ |
268 | show_in##offset, NULL); \ | 268 | show_in##offset, NULL); \ |
269 | static ssize_t \ | 269 | static ssize_t \ |
270 | show_in##offset##_min (struct device *dev, char *buf) \ | 270 | show_in##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \ |
271 | { \ | 271 | { \ |
272 | return show_in_min(dev, buf, offset); \ | 272 | return show_in_min(dev, buf, offset); \ |
273 | } \ | 273 | } \ |
274 | static ssize_t \ | 274 | static ssize_t \ |
275 | show_in##offset##_max (struct device *dev, char *buf) \ | 275 | show_in##offset##_max (struct device *dev, struct device_attribute *attr, char *buf) \ |
276 | { \ | 276 | { \ |
277 | return show_in_max(dev, buf, offset); \ | 277 | return show_in_max(dev, buf, offset); \ |
278 | } \ | 278 | } \ |
279 | static ssize_t set_in##offset##_min (struct device *dev, \ | 279 | static ssize_t set_in##offset##_min (struct device *dev, struct device_attribute *attr, \ |
280 | const char *buf, size_t count) \ | 280 | const char *buf, size_t count) \ |
281 | { \ | 281 | { \ |
282 | return set_in_min(dev, buf, count, offset); \ | 282 | return set_in_min(dev, buf, count, offset); \ |
283 | } \ | 283 | } \ |
284 | static ssize_t set_in##offset##_max (struct device *dev, \ | 284 | static ssize_t set_in##offset##_max (struct device *dev, struct device_attribute *attr, \ |
285 | const char *buf, size_t count) \ | 285 | const char *buf, size_t count) \ |
286 | { \ | 286 | { \ |
287 | return set_in_max(dev, buf, count, offset); \ | 287 | return set_in_max(dev, buf, count, offset); \ |
@@ -389,24 +389,24 @@ static ssize_t set_fan_div(struct device *dev, const char *buf, | |||
389 | } | 389 | } |
390 | 390 | ||
391 | #define sysfs_fan(offset) \ | 391 | #define sysfs_fan(offset) \ |
392 | static ssize_t show_fan##offset(struct device *dev, char *buf) \ | 392 | static ssize_t show_fan##offset(struct device *dev, struct device_attribute *attr, char *buf) \ |
393 | { \ | 393 | { \ |
394 | return show_fan(dev, buf, offset - 1); \ | 394 | return show_fan(dev, buf, offset - 1); \ |
395 | } \ | 395 | } \ |
396 | static ssize_t show_fan##offset##_min(struct device *dev, char *buf) \ | 396 | static ssize_t show_fan##offset##_min(struct device *dev, struct device_attribute *attr, char *buf) \ |
397 | { \ | 397 | { \ |
398 | return show_fan_min(dev, buf, offset - 1); \ | 398 | return show_fan_min(dev, buf, offset - 1); \ |
399 | } \ | 399 | } \ |
400 | static ssize_t show_fan##offset##_div(struct device *dev, char *buf) \ | 400 | static ssize_t show_fan##offset##_div(struct device *dev, struct device_attribute *attr, char *buf) \ |
401 | { \ | 401 | { \ |
402 | return show_fan_div(dev, buf, offset - 1); \ | 402 | return show_fan_div(dev, buf, offset - 1); \ |
403 | } \ | 403 | } \ |
404 | static ssize_t set_fan##offset##_min(struct device *dev, const char *buf, \ | 404 | static ssize_t set_fan##offset##_min(struct device *dev, struct device_attribute *attr, const char *buf, \ |
405 | size_t count) \ | 405 | size_t count) \ |
406 | { \ | 406 | { \ |
407 | return set_fan_min(dev, buf, count, offset - 1); \ | 407 | return set_fan_min(dev, buf, count, offset - 1); \ |
408 | } \ | 408 | } \ |
409 | static ssize_t set_fan##offset##_div(struct device *dev, const char *buf, \ | 409 | static ssize_t set_fan##offset##_div(struct device *dev, struct device_attribute *attr, const char *buf, \ |
410 | size_t count) \ | 410 | size_t count) \ |
411 | { \ | 411 | { \ |
412 | return set_fan_div(dev, buf, count, offset - 1); \ | 412 | return set_fan_div(dev, buf, count, offset - 1); \ |
@@ -482,27 +482,27 @@ set_temp_reg(MAX, temp_max); | |||
482 | set_temp_reg(HYST, temp_hyst); | 482 | set_temp_reg(HYST, temp_hyst); |
483 | 483 | ||
484 | #define sysfs_temp(num) \ | 484 | #define sysfs_temp(num) \ |
485 | static ssize_t show_temp##num(struct device *dev, char *buf) \ | 485 | static ssize_t show_temp##num(struct device *dev, struct device_attribute *attr, char *buf) \ |
486 | { \ | 486 | { \ |
487 | return show_temp(dev, buf, num-1); \ | 487 | return show_temp(dev, buf, num-1); \ |
488 | } \ | 488 | } \ |
489 | static DEVICE_ATTR(temp##num##_input, S_IRUGO, show_temp##num, NULL); \ | 489 | static DEVICE_ATTR(temp##num##_input, S_IRUGO, show_temp##num, NULL); \ |
490 | static ssize_t show_temp_max##num(struct device *dev, char *buf) \ | 490 | static ssize_t show_temp_max##num(struct device *dev, struct device_attribute *attr, char *buf) \ |
491 | { \ | 491 | { \ |
492 | return show_temp_max(dev, buf, num-1); \ | 492 | return show_temp_max(dev, buf, num-1); \ |
493 | } \ | 493 | } \ |
494 | static ssize_t set_temp_max##num(struct device *dev, const char *buf, \ | 494 | static ssize_t set_temp_max##num(struct device *dev, struct device_attribute *attr, const char *buf, \ |
495 | size_t count) \ | 495 | size_t count) \ |
496 | { \ | 496 | { \ |
497 | return set_temp_max(dev, buf, count, num-1); \ | 497 | return set_temp_max(dev, buf, count, num-1); \ |
498 | } \ | 498 | } \ |
499 | static DEVICE_ATTR(temp##num##_max, S_IRUGO | S_IWUSR, \ | 499 | static DEVICE_ATTR(temp##num##_max, S_IRUGO | S_IWUSR, \ |
500 | show_temp_max##num, set_temp_max##num); \ | 500 | show_temp_max##num, set_temp_max##num); \ |
501 | static ssize_t show_temp_hyst##num(struct device *dev, char *buf) \ | 501 | static ssize_t show_temp_hyst##num(struct device *dev, struct device_attribute *attr, char *buf) \ |
502 | { \ | 502 | { \ |
503 | return show_temp_hyst(dev, buf, num-1); \ | 503 | return show_temp_hyst(dev, buf, num-1); \ |
504 | } \ | 504 | } \ |
505 | static ssize_t set_temp_hyst##num(struct device *dev, const char *buf, \ | 505 | static ssize_t set_temp_hyst##num(struct device *dev, struct device_attribute *attr, const char *buf, \ |
506 | size_t count) \ | 506 | size_t count) \ |
507 | { \ | 507 | { \ |
508 | return set_temp_hyst(dev, buf, count, num-1); \ | 508 | return set_temp_hyst(dev, buf, count, num-1); \ |
@@ -522,7 +522,7 @@ sysfs_temp(4); | |||
522 | device_create_file(&client->dev, &dev_attr_temp##num##_max_hyst); \ | 522 | device_create_file(&client->dev, &dev_attr_temp##num##_max_hyst); \ |
523 | } while (0) | 523 | } while (0) |
524 | 524 | ||
525 | static ssize_t show_vid(struct device *dev, char *buf) | 525 | static ssize_t show_vid(struct device *dev, struct device_attribute *attr, char *buf) |
526 | { | 526 | { |
527 | struct asb100_data *data = asb100_update_device(dev); | 527 | struct asb100_data *data = asb100_update_device(dev); |
528 | return sprintf(buf, "%d\n", vid_from_reg(data->vid, data->vrm)); | 528 | return sprintf(buf, "%d\n", vid_from_reg(data->vid, data->vrm)); |
@@ -533,13 +533,13 @@ static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid, NULL); | |||
533 | device_create_file(&client->dev, &dev_attr_cpu0_vid) | 533 | device_create_file(&client->dev, &dev_attr_cpu0_vid) |
534 | 534 | ||
535 | /* VRM */ | 535 | /* VRM */ |
536 | static ssize_t show_vrm(struct device *dev, char *buf) | 536 | static ssize_t show_vrm(struct device *dev, struct device_attribute *attr, char *buf) |
537 | { | 537 | { |
538 | struct asb100_data *data = asb100_update_device(dev); | 538 | struct asb100_data *data = asb100_update_device(dev); |
539 | return sprintf(buf, "%d\n", data->vrm); | 539 | return sprintf(buf, "%d\n", data->vrm); |
540 | } | 540 | } |
541 | 541 | ||
542 | static ssize_t set_vrm(struct device *dev, const char *buf, size_t count) | 542 | static ssize_t set_vrm(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) |
543 | { | 543 | { |
544 | struct i2c_client *client = to_i2c_client(dev); | 544 | struct i2c_client *client = to_i2c_client(dev); |
545 | struct asb100_data *data = i2c_get_clientdata(client); | 545 | struct asb100_data *data = i2c_get_clientdata(client); |
@@ -553,7 +553,7 @@ static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm, set_vrm); | |||
553 | #define device_create_file_vrm(client) \ | 553 | #define device_create_file_vrm(client) \ |
554 | device_create_file(&client->dev, &dev_attr_vrm); | 554 | device_create_file(&client->dev, &dev_attr_vrm); |
555 | 555 | ||
556 | static ssize_t show_alarms(struct device *dev, char *buf) | 556 | static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf) |
557 | { | 557 | { |
558 | struct asb100_data *data = asb100_update_device(dev); | 558 | struct asb100_data *data = asb100_update_device(dev); |
559 | return sprintf(buf, "%d\n", ALARMS_FROM_REG(data->alarms)); | 559 | return sprintf(buf, "%d\n", ALARMS_FROM_REG(data->alarms)); |
@@ -564,13 +564,13 @@ static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL); | |||
564 | device_create_file(&client->dev, &dev_attr_alarms) | 564 | device_create_file(&client->dev, &dev_attr_alarms) |
565 | 565 | ||
566 | /* 1 PWM */ | 566 | /* 1 PWM */ |
567 | static ssize_t show_pwm1(struct device *dev, char *buf) | 567 | static ssize_t show_pwm1(struct device *dev, struct device_attribute *attr, char *buf) |
568 | { | 568 | { |
569 | struct asb100_data *data = asb100_update_device(dev); | 569 | struct asb100_data *data = asb100_update_device(dev); |
570 | return sprintf(buf, "%d\n", ASB100_PWM_FROM_REG(data->pwm & 0x0f)); | 570 | return sprintf(buf, "%d\n", ASB100_PWM_FROM_REG(data->pwm & 0x0f)); |
571 | } | 571 | } |
572 | 572 | ||
573 | static ssize_t set_pwm1(struct device *dev, const char *buf, size_t count) | 573 | static ssize_t set_pwm1(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) |
574 | { | 574 | { |
575 | struct i2c_client *client = to_i2c_client(dev); | 575 | struct i2c_client *client = to_i2c_client(dev); |
576 | struct asb100_data *data = i2c_get_clientdata(client); | 576 | struct asb100_data *data = i2c_get_clientdata(client); |
@@ -584,13 +584,13 @@ static ssize_t set_pwm1(struct device *dev, const char *buf, size_t count) | |||
584 | return count; | 584 | return count; |
585 | } | 585 | } |
586 | 586 | ||
587 | static ssize_t show_pwm_enable1(struct device *dev, char *buf) | 587 | static ssize_t show_pwm_enable1(struct device *dev, struct device_attribute *attr, char *buf) |
588 | { | 588 | { |
589 | struct asb100_data *data = asb100_update_device(dev); | 589 | struct asb100_data *data = asb100_update_device(dev); |
590 | return sprintf(buf, "%d\n", (data->pwm & 0x80) ? 1 : 0); | 590 | return sprintf(buf, "%d\n", (data->pwm & 0x80) ? 1 : 0); |
591 | } | 591 | } |
592 | 592 | ||
593 | static ssize_t set_pwm_enable1(struct device *dev, const char *buf, | 593 | static ssize_t set_pwm_enable1(struct device *dev, struct device_attribute *attr, const char *buf, |
594 | size_t count) | 594 | size_t count) |
595 | { | 595 | { |
596 | struct i2c_client *client = to_i2c_client(dev); | 596 | struct i2c_client *client = to_i2c_client(dev); |
diff --git a/drivers/i2c/chips/ds1621.c b/drivers/i2c/chips/ds1621.c index bb1fefb2162e..4ae15bd5dcfb 100644 --- a/drivers/i2c/chips/ds1621.c +++ b/drivers/i2c/chips/ds1621.c | |||
@@ -137,7 +137,7 @@ static void ds1621_init_client(struct i2c_client *client) | |||
137 | } | 137 | } |
138 | 138 | ||
139 | #define show(value) \ | 139 | #define show(value) \ |
140 | static ssize_t show_##value(struct device *dev, char *buf) \ | 140 | static ssize_t show_##value(struct device *dev, struct device_attribute *attr, char *buf) \ |
141 | { \ | 141 | { \ |
142 | struct ds1621_data *data = ds1621_update_client(dev); \ | 142 | struct ds1621_data *data = ds1621_update_client(dev); \ |
143 | return sprintf(buf, "%d\n", LM75_TEMP_FROM_REG(data->value)); \ | 143 | return sprintf(buf, "%d\n", LM75_TEMP_FROM_REG(data->value)); \ |
@@ -148,7 +148,7 @@ show(temp_min); | |||
148 | show(temp_max); | 148 | show(temp_max); |
149 | 149 | ||
150 | #define set_temp(suffix, value, reg) \ | 150 | #define set_temp(suffix, value, reg) \ |
151 | static ssize_t set_temp_##suffix(struct device *dev, const char *buf, \ | 151 | static ssize_t set_temp_##suffix(struct device *dev, struct device_attribute *attr, const char *buf, \ |
152 | size_t count) \ | 152 | size_t count) \ |
153 | { \ | 153 | { \ |
154 | struct i2c_client *client = to_i2c_client(dev); \ | 154 | struct i2c_client *client = to_i2c_client(dev); \ |
@@ -165,7 +165,7 @@ static ssize_t set_temp_##suffix(struct device *dev, const char *buf, \ | |||
165 | set_temp(min, temp_min, DS1621_REG_TEMP_MIN); | 165 | set_temp(min, temp_min, DS1621_REG_TEMP_MIN); |
166 | set_temp(max, temp_max, DS1621_REG_TEMP_MAX); | 166 | set_temp(max, temp_max, DS1621_REG_TEMP_MAX); |
167 | 167 | ||
168 | static ssize_t show_alarms(struct device *dev, char *buf) | 168 | static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf) |
169 | { | 169 | { |
170 | struct ds1621_data *data = ds1621_update_client(dev); | 170 | struct ds1621_data *data = ds1621_update_client(dev); |
171 | return sprintf(buf, "%d\n", ALARMS_FROM_REG(data->conf)); | 171 | return sprintf(buf, "%d\n", ALARMS_FROM_REG(data->conf)); |
diff --git a/drivers/i2c/chips/fscher.c b/drivers/i2c/chips/fscher.c index 18e33ac59d0c..c3f37dbec11a 100644 --- a/drivers/i2c/chips/fscher.c +++ b/drivers/i2c/chips/fscher.c | |||
@@ -157,8 +157,8 @@ struct fscher_data { | |||
157 | 157 | ||
158 | #define sysfs_r(kind, sub, offset, reg) \ | 158 | #define sysfs_r(kind, sub, offset, reg) \ |
159 | static ssize_t show_##kind##sub (struct fscher_data *, char *, int); \ | 159 | static ssize_t show_##kind##sub (struct fscher_data *, char *, int); \ |
160 | static ssize_t show_##kind##offset##sub (struct device *, char *); \ | 160 | static ssize_t show_##kind##offset##sub (struct device *, struct device_attribute *attr, char *); \ |
161 | static ssize_t show_##kind##offset##sub (struct device *dev, char *buf) \ | 161 | static ssize_t show_##kind##offset##sub (struct device *dev, struct device_attribute *attr, char *buf) \ |
162 | { \ | 162 | { \ |
163 | struct fscher_data *data = fscher_update_device(dev); \ | 163 | struct fscher_data *data = fscher_update_device(dev); \ |
164 | return show_##kind##sub(data, buf, (offset)); \ | 164 | return show_##kind##sub(data, buf, (offset)); \ |
@@ -166,8 +166,8 @@ static ssize_t show_##kind##offset##sub (struct device *dev, char *buf) \ | |||
166 | 166 | ||
167 | #define sysfs_w(kind, sub, offset, reg) \ | 167 | #define sysfs_w(kind, sub, offset, reg) \ |
168 | static ssize_t set_##kind##sub (struct i2c_client *, struct fscher_data *, const char *, size_t, int, int); \ | 168 | static ssize_t set_##kind##sub (struct i2c_client *, struct fscher_data *, const char *, size_t, int, int); \ |
169 | static ssize_t set_##kind##offset##sub (struct device *, const char *, size_t); \ | 169 | static ssize_t set_##kind##offset##sub (struct device *, struct device_attribute *attr, const char *, size_t); \ |
170 | static ssize_t set_##kind##offset##sub (struct device *dev, const char *buf, size_t count) \ | 170 | static ssize_t set_##kind##offset##sub (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \ |
171 | { \ | 171 | { \ |
172 | struct i2c_client *client = to_i2c_client(dev); \ | 172 | struct i2c_client *client = to_i2c_client(dev); \ |
173 | struct fscher_data *data = i2c_get_clientdata(client); \ | 173 | struct fscher_data *data = i2c_get_clientdata(client); \ |
diff --git a/drivers/i2c/chips/fscpos.c b/drivers/i2c/chips/fscpos.c index 2cac79145c75..3beaa6191ef4 100644 --- a/drivers/i2c/chips/fscpos.c +++ b/drivers/i2c/chips/fscpos.c | |||
@@ -245,19 +245,19 @@ static void reset_fan_alarm(struct i2c_client *client, int nr) | |||
245 | /* Volts */ | 245 | /* Volts */ |
246 | #define VOLT_FROM_REG(val, mult) ((val) * (mult) / 255) | 246 | #define VOLT_FROM_REG(val, mult) ((val) * (mult) / 255) |
247 | 247 | ||
248 | static ssize_t show_volt_12(struct device *dev, char *buf) | 248 | static ssize_t show_volt_12(struct device *dev, struct device_attribute *attr, char *buf) |
249 | { | 249 | { |
250 | struct fscpos_data *data = fscpos_update_device(dev); | 250 | struct fscpos_data *data = fscpos_update_device(dev); |
251 | return sprintf(buf, "%u\n", VOLT_FROM_REG(data->volt[0], 14200)); | 251 | return sprintf(buf, "%u\n", VOLT_FROM_REG(data->volt[0], 14200)); |
252 | } | 252 | } |
253 | 253 | ||
254 | static ssize_t show_volt_5(struct device *dev, char *buf) | 254 | static ssize_t show_volt_5(struct device *dev, struct device_attribute *attr, char *buf) |
255 | { | 255 | { |
256 | struct fscpos_data *data = fscpos_update_device(dev); | 256 | struct fscpos_data *data = fscpos_update_device(dev); |
257 | return sprintf(buf, "%u\n", VOLT_FROM_REG(data->volt[1], 6600)); | 257 | return sprintf(buf, "%u\n", VOLT_FROM_REG(data->volt[1], 6600)); |
258 | } | 258 | } |
259 | 259 | ||
260 | static ssize_t show_volt_batt(struct device *dev, char *buf) | 260 | static ssize_t show_volt_batt(struct device *dev, struct device_attribute *attr, char *buf) |
261 | { | 261 | { |
262 | struct fscpos_data *data = fscpos_update_device(dev); | 262 | struct fscpos_data *data = fscpos_update_device(dev); |
263 | return sprintf(buf, "%u\n", VOLT_FROM_REG(data->volt[2], 3300)); | 263 | return sprintf(buf, "%u\n", VOLT_FROM_REG(data->volt[2], 3300)); |
@@ -327,7 +327,7 @@ static ssize_t set_wdog_preset(struct i2c_client *client, struct fscpos_data | |||
327 | } | 327 | } |
328 | 328 | ||
329 | /* Event */ | 329 | /* Event */ |
330 | static ssize_t show_event(struct device *dev, char *buf) | 330 | static ssize_t show_event(struct device *dev, struct device_attribute *attr, char *buf) |
331 | { | 331 | { |
332 | /* bits 5..7 reserved => mask with 0x1f */ | 332 | /* bits 5..7 reserved => mask with 0x1f */ |
333 | struct fscpos_data *data = fscpos_update_device(dev); | 333 | struct fscpos_data *data = fscpos_update_device(dev); |
@@ -338,14 +338,14 @@ static ssize_t show_event(struct device *dev, char *buf) | |||
338 | * Sysfs stuff | 338 | * Sysfs stuff |
339 | */ | 339 | */ |
340 | #define create_getter(kind, sub) \ | 340 | #define create_getter(kind, sub) \ |
341 | static ssize_t sysfs_show_##kind##sub(struct device *dev, char *buf) \ | 341 | static ssize_t sysfs_show_##kind##sub(struct device *dev, struct device_attribute *attr, char *buf) \ |
342 | { \ | 342 | { \ |
343 | struct fscpos_data *data = fscpos_update_device(dev); \ | 343 | struct fscpos_data *data = fscpos_update_device(dev); \ |
344 | return show_##kind##sub(data, buf); \ | 344 | return show_##kind##sub(data, buf); \ |
345 | } | 345 | } |
346 | 346 | ||
347 | #define create_getter_n(kind, offset, sub) \ | 347 | #define create_getter_n(kind, offset, sub) \ |
348 | static ssize_t sysfs_show_##kind##offset##sub(struct device *dev, char\ | 348 | static ssize_t sysfs_show_##kind##offset##sub(struct device *dev, struct device_attribute *attr, char\ |
349 | *buf) \ | 349 | *buf) \ |
350 | { \ | 350 | { \ |
351 | struct fscpos_data *data = fscpos_update_device(dev); \ | 351 | struct fscpos_data *data = fscpos_update_device(dev); \ |
@@ -353,7 +353,7 @@ static ssize_t show_event(struct device *dev, char *buf) | |||
353 | } | 353 | } |
354 | 354 | ||
355 | #define create_setter(kind, sub, reg) \ | 355 | #define create_setter(kind, sub, reg) \ |
356 | static ssize_t sysfs_set_##kind##sub (struct device *dev, const char \ | 356 | static ssize_t sysfs_set_##kind##sub (struct device *dev, struct device_attribute *attr, const char \ |
357 | *buf, size_t count) \ | 357 | *buf, size_t count) \ |
358 | { \ | 358 | { \ |
359 | struct i2c_client *client = to_i2c_client(dev); \ | 359 | struct i2c_client *client = to_i2c_client(dev); \ |
@@ -362,7 +362,7 @@ static ssize_t show_event(struct device *dev, char *buf) | |||
362 | } | 362 | } |
363 | 363 | ||
364 | #define create_setter_n(kind, offset, sub, reg) \ | 364 | #define create_setter_n(kind, offset, sub, reg) \ |
365 | static ssize_t sysfs_set_##kind##offset##sub (struct device *dev, \ | 365 | static ssize_t sysfs_set_##kind##offset##sub (struct device *dev, struct device_attribute *attr, \ |
366 | const char *buf, size_t count) \ | 366 | const char *buf, size_t count) \ |
367 | { \ | 367 | { \ |
368 | struct i2c_client *client = to_i2c_client(dev); \ | 368 | struct i2c_client *client = to_i2c_client(dev); \ |
diff --git a/drivers/i2c/chips/gl518sm.c b/drivers/i2c/chips/gl518sm.c index c82d6ce21205..4316a1562251 100644 --- a/drivers/i2c/chips/gl518sm.c +++ b/drivers/i2c/chips/gl518sm.c | |||
@@ -164,14 +164,14 @@ static struct i2c_driver gl518_driver = { | |||
164 | */ | 164 | */ |
165 | 165 | ||
166 | #define show(type, suffix, value) \ | 166 | #define show(type, suffix, value) \ |
167 | static ssize_t show_##suffix(struct device *dev, char *buf) \ | 167 | static ssize_t show_##suffix(struct device *dev, struct device_attribute *attr, char *buf) \ |
168 | { \ | 168 | { \ |
169 | struct gl518_data *data = gl518_update_device(dev); \ | 169 | struct gl518_data *data = gl518_update_device(dev); \ |
170 | return sprintf(buf, "%d\n", type##_FROM_REG(data->value)); \ | 170 | return sprintf(buf, "%d\n", type##_FROM_REG(data->value)); \ |
171 | } | 171 | } |
172 | 172 | ||
173 | #define show_fan(suffix, value, index) \ | 173 | #define show_fan(suffix, value, index) \ |
174 | static ssize_t show_##suffix(struct device *dev, char *buf) \ | 174 | static ssize_t show_##suffix(struct device *dev, struct device_attribute *attr, char *buf) \ |
175 | { \ | 175 | { \ |
176 | struct gl518_data *data = gl518_update_device(dev); \ | 176 | struct gl518_data *data = gl518_update_device(dev); \ |
177 | return sprintf(buf, "%d\n", FAN_FROM_REG(data->value[index], \ | 177 | return sprintf(buf, "%d\n", FAN_FROM_REG(data->value[index], \ |
@@ -205,7 +205,7 @@ show(BOOL, beep_enable, beep_enable); | |||
205 | show(BEEP_MASK, beep_mask, beep_mask); | 205 | show(BEEP_MASK, beep_mask, beep_mask); |
206 | 206 | ||
207 | #define set(type, suffix, value, reg) \ | 207 | #define set(type, suffix, value, reg) \ |
208 | static ssize_t set_##suffix(struct device *dev, const char *buf, \ | 208 | static ssize_t set_##suffix(struct device *dev, struct device_attribute *attr, const char *buf, \ |
209 | size_t count) \ | 209 | size_t count) \ |
210 | { \ | 210 | { \ |
211 | struct i2c_client *client = to_i2c_client(dev); \ | 211 | struct i2c_client *client = to_i2c_client(dev); \ |
@@ -220,7 +220,7 @@ static ssize_t set_##suffix(struct device *dev, const char *buf, \ | |||
220 | } | 220 | } |
221 | 221 | ||
222 | #define set_bits(type, suffix, value, reg, mask, shift) \ | 222 | #define set_bits(type, suffix, value, reg, mask, shift) \ |
223 | static ssize_t set_##suffix(struct device *dev, const char *buf, \ | 223 | static ssize_t set_##suffix(struct device *dev, struct device_attribute *attr, const char *buf, \ |
224 | size_t count) \ | 224 | size_t count) \ |
225 | { \ | 225 | { \ |
226 | struct i2c_client *client = to_i2c_client(dev); \ | 226 | struct i2c_client *client = to_i2c_client(dev); \ |
@@ -258,7 +258,7 @@ set_high(IN, in_max3, voltage_max[3], GL518_REG_VIN3_LIMIT); | |||
258 | set_bits(BOOL, beep_enable, beep_enable, GL518_REG_CONF, 0x04, 2); | 258 | set_bits(BOOL, beep_enable, beep_enable, GL518_REG_CONF, 0x04, 2); |
259 | set(BEEP_MASK, beep_mask, beep_mask, GL518_REG_ALARM); | 259 | set(BEEP_MASK, beep_mask, beep_mask, GL518_REG_ALARM); |
260 | 260 | ||
261 | static ssize_t set_fan_min1(struct device *dev, const char *buf, size_t count) | 261 | static ssize_t set_fan_min1(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) |
262 | { | 262 | { |
263 | struct i2c_client *client = to_i2c_client(dev); | 263 | struct i2c_client *client = to_i2c_client(dev); |
264 | struct gl518_data *data = i2c_get_clientdata(client); | 264 | struct gl518_data *data = i2c_get_clientdata(client); |
@@ -284,7 +284,7 @@ static ssize_t set_fan_min1(struct device *dev, const char *buf, size_t count) | |||
284 | return count; | 284 | return count; |
285 | } | 285 | } |
286 | 286 | ||
287 | static ssize_t set_fan_min2(struct device *dev, const char *buf, size_t count) | 287 | static ssize_t set_fan_min2(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) |
288 | { | 288 | { |
289 | struct i2c_client *client = to_i2c_client(dev); | 289 | struct i2c_client *client = to_i2c_client(dev); |
290 | struct gl518_data *data = i2c_get_clientdata(client); | 290 | struct gl518_data *data = i2c_get_clientdata(client); |
diff --git a/drivers/i2c/chips/gl520sm.c b/drivers/i2c/chips/gl520sm.c index 3fd17e46ffc6..a13a504f5bfa 100644 --- a/drivers/i2c/chips/gl520sm.c +++ b/drivers/i2c/chips/gl520sm.c | |||
@@ -148,8 +148,8 @@ struct gl520_data { | |||
148 | 148 | ||
149 | #define sysfs_r(type, n, item, reg) \ | 149 | #define sysfs_r(type, n, item, reg) \ |
150 | static ssize_t get_##type##item (struct gl520_data *, char *, int); \ | 150 | static ssize_t get_##type##item (struct gl520_data *, char *, int); \ |
151 | static ssize_t get_##type##n##item (struct device *, char *); \ | 151 | static ssize_t get_##type##n##item (struct device *, struct device_attribute *attr, char *); \ |
152 | static ssize_t get_##type##n##item (struct device *dev, char *buf) \ | 152 | static ssize_t get_##type##n##item (struct device *dev, struct device_attribute *attr, char *buf) \ |
153 | { \ | 153 | { \ |
154 | struct gl520_data *data = gl520_update_device(dev); \ | 154 | struct gl520_data *data = gl520_update_device(dev); \ |
155 | return get_##type##item(data, buf, (n)); \ | 155 | return get_##type##item(data, buf, (n)); \ |
@@ -157,8 +157,8 @@ static ssize_t get_##type##n##item (struct device *dev, char *buf) \ | |||
157 | 157 | ||
158 | #define sysfs_w(type, n, item, reg) \ | 158 | #define sysfs_w(type, n, item, reg) \ |
159 | static ssize_t set_##type##item (struct i2c_client *, struct gl520_data *, const char *, size_t, int, int); \ | 159 | static ssize_t set_##type##item (struct i2c_client *, struct gl520_data *, const char *, size_t, int, int); \ |
160 | static ssize_t set_##type##n##item (struct device *, const char *, size_t); \ | 160 | static ssize_t set_##type##n##item (struct device *, struct device_attribute *attr, const char *, size_t); \ |
161 | static ssize_t set_##type##n##item (struct device *dev, const char *buf, size_t count) \ | 161 | static ssize_t set_##type##n##item (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \ |
162 | { \ | 162 | { \ |
163 | struct i2c_client *client = to_i2c_client(dev); \ | 163 | struct i2c_client *client = to_i2c_client(dev); \ |
164 | struct gl520_data *data = i2c_get_clientdata(client); \ | 164 | struct gl520_data *data = i2c_get_clientdata(client); \ |
diff --git a/drivers/i2c/chips/it87.c b/drivers/i2c/chips/it87.c index cf7e6898754f..007bdf9e7e2a 100644 --- a/drivers/i2c/chips/it87.c +++ b/drivers/i2c/chips/it87.c | |||
@@ -290,7 +290,7 @@ static ssize_t set_in_max(struct device *dev, const char *buf, | |||
290 | 290 | ||
291 | #define show_in_offset(offset) \ | 291 | #define show_in_offset(offset) \ |
292 | static ssize_t \ | 292 | static ssize_t \ |
293 | show_in##offset (struct device *dev, char *buf) \ | 293 | show_in##offset (struct device *dev, struct device_attribute *attr, char *buf) \ |
294 | { \ | 294 | { \ |
295 | return show_in(dev, buf, offset); \ | 295 | return show_in(dev, buf, offset); \ |
296 | } \ | 296 | } \ |
@@ -298,21 +298,21 @@ static DEVICE_ATTR(in##offset##_input, S_IRUGO, show_in##offset, NULL); | |||
298 | 298 | ||
299 | #define limit_in_offset(offset) \ | 299 | #define limit_in_offset(offset) \ |
300 | static ssize_t \ | 300 | static ssize_t \ |
301 | show_in##offset##_min (struct device *dev, char *buf) \ | 301 | show_in##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \ |
302 | { \ | 302 | { \ |
303 | return show_in_min(dev, buf, offset); \ | 303 | return show_in_min(dev, buf, offset); \ |
304 | } \ | 304 | } \ |
305 | static ssize_t \ | 305 | static ssize_t \ |
306 | show_in##offset##_max (struct device *dev, char *buf) \ | 306 | show_in##offset##_max (struct device *dev, struct device_attribute *attr, char *buf) \ |
307 | { \ | 307 | { \ |
308 | return show_in_max(dev, buf, offset); \ | 308 | return show_in_max(dev, buf, offset); \ |
309 | } \ | 309 | } \ |
310 | static ssize_t set_in##offset##_min (struct device *dev, \ | 310 | static ssize_t set_in##offset##_min (struct device *dev, struct device_attribute *attr, \ |
311 | const char *buf, size_t count) \ | 311 | const char *buf, size_t count) \ |
312 | { \ | 312 | { \ |
313 | return set_in_min(dev, buf, count, offset); \ | 313 | return set_in_min(dev, buf, count, offset); \ |
314 | } \ | 314 | } \ |
315 | static ssize_t set_in##offset##_max (struct device *dev, \ | 315 | static ssize_t set_in##offset##_max (struct device *dev, struct device_attribute *attr, \ |
316 | const char *buf, size_t count) \ | 316 | const char *buf, size_t count) \ |
317 | { \ | 317 | { \ |
318 | return set_in_max(dev, buf, count, offset); \ | 318 | return set_in_max(dev, buf, count, offset); \ |
@@ -383,26 +383,26 @@ static ssize_t set_temp_min(struct device *dev, const char *buf, | |||
383 | return count; | 383 | return count; |
384 | } | 384 | } |
385 | #define show_temp_offset(offset) \ | 385 | #define show_temp_offset(offset) \ |
386 | static ssize_t show_temp_##offset (struct device *dev, char *buf) \ | 386 | static ssize_t show_temp_##offset (struct device *dev, struct device_attribute *attr, char *buf) \ |
387 | { \ | 387 | { \ |
388 | return show_temp(dev, buf, offset - 1); \ | 388 | return show_temp(dev, buf, offset - 1); \ |
389 | } \ | 389 | } \ |
390 | static ssize_t \ | 390 | static ssize_t \ |
391 | show_temp_##offset##_max (struct device *dev, char *buf) \ | 391 | show_temp_##offset##_max (struct device *dev, struct device_attribute *attr, char *buf) \ |
392 | { \ | 392 | { \ |
393 | return show_temp_max(dev, buf, offset - 1); \ | 393 | return show_temp_max(dev, buf, offset - 1); \ |
394 | } \ | 394 | } \ |
395 | static ssize_t \ | 395 | static ssize_t \ |
396 | show_temp_##offset##_min (struct device *dev, char *buf) \ | 396 | show_temp_##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \ |
397 | { \ | 397 | { \ |
398 | return show_temp_min(dev, buf, offset - 1); \ | 398 | return show_temp_min(dev, buf, offset - 1); \ |
399 | } \ | 399 | } \ |
400 | static ssize_t set_temp_##offset##_max (struct device *dev, \ | 400 | static ssize_t set_temp_##offset##_max (struct device *dev, struct device_attribute *attr, \ |
401 | const char *buf, size_t count) \ | 401 | const char *buf, size_t count) \ |
402 | { \ | 402 | { \ |
403 | return set_temp_max(dev, buf, count, offset - 1); \ | 403 | return set_temp_max(dev, buf, count, offset - 1); \ |
404 | } \ | 404 | } \ |
405 | static ssize_t set_temp_##offset##_min (struct device *dev, \ | 405 | static ssize_t set_temp_##offset##_min (struct device *dev, struct device_attribute *attr, \ |
406 | const char *buf, size_t count) \ | 406 | const char *buf, size_t count) \ |
407 | { \ | 407 | { \ |
408 | return set_temp_min(dev, buf, count, offset - 1); \ | 408 | return set_temp_min(dev, buf, count, offset - 1); \ |
@@ -453,11 +453,11 @@ static ssize_t set_sensor(struct device *dev, const char *buf, | |||
453 | return count; | 453 | return count; |
454 | } | 454 | } |
455 | #define show_sensor_offset(offset) \ | 455 | #define show_sensor_offset(offset) \ |
456 | static ssize_t show_sensor_##offset (struct device *dev, char *buf) \ | 456 | static ssize_t show_sensor_##offset (struct device *dev, struct device_attribute *attr, char *buf) \ |
457 | { \ | 457 | { \ |
458 | return show_sensor(dev, buf, offset - 1); \ | 458 | return show_sensor(dev, buf, offset - 1); \ |
459 | } \ | 459 | } \ |
460 | static ssize_t set_sensor_##offset (struct device *dev, \ | 460 | static ssize_t set_sensor_##offset (struct device *dev, struct device_attribute *attr, \ |
461 | const char *buf, size_t count) \ | 461 | const char *buf, size_t count) \ |
462 | { \ | 462 | { \ |
463 | return set_sensor(dev, buf, count, offset - 1); \ | 463 | return set_sensor(dev, buf, count, offset - 1); \ |
@@ -600,24 +600,24 @@ static ssize_t set_pwm(struct device *dev, const char *buf, | |||
600 | } | 600 | } |
601 | 601 | ||
602 | #define show_fan_offset(offset) \ | 602 | #define show_fan_offset(offset) \ |
603 | static ssize_t show_fan_##offset (struct device *dev, char *buf) \ | 603 | static ssize_t show_fan_##offset (struct device *dev, struct device_attribute *attr, char *buf) \ |
604 | { \ | 604 | { \ |
605 | return show_fan(dev, buf, offset - 1); \ | 605 | return show_fan(dev, buf, offset - 1); \ |
606 | } \ | 606 | } \ |
607 | static ssize_t show_fan_##offset##_min (struct device *dev, char *buf) \ | 607 | static ssize_t show_fan_##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \ |
608 | { \ | 608 | { \ |
609 | return show_fan_min(dev, buf, offset - 1); \ | 609 | return show_fan_min(dev, buf, offset - 1); \ |
610 | } \ | 610 | } \ |
611 | static ssize_t show_fan_##offset##_div (struct device *dev, char *buf) \ | 611 | static ssize_t show_fan_##offset##_div (struct device *dev, struct device_attribute *attr, char *buf) \ |
612 | { \ | 612 | { \ |
613 | return show_fan_div(dev, buf, offset - 1); \ | 613 | return show_fan_div(dev, buf, offset - 1); \ |
614 | } \ | 614 | } \ |
615 | static ssize_t set_fan_##offset##_min (struct device *dev, \ | 615 | static ssize_t set_fan_##offset##_min (struct device *dev, struct device_attribute *attr, \ |
616 | const char *buf, size_t count) \ | 616 | const char *buf, size_t count) \ |
617 | { \ | 617 | { \ |
618 | return set_fan_min(dev, buf, count, offset - 1); \ | 618 | return set_fan_min(dev, buf, count, offset - 1); \ |
619 | } \ | 619 | } \ |
620 | static ssize_t set_fan_##offset##_div (struct device *dev, \ | 620 | static ssize_t set_fan_##offset##_div (struct device *dev, struct device_attribute *attr, \ |
621 | const char *buf, size_t count) \ | 621 | const char *buf, size_t count) \ |
622 | { \ | 622 | { \ |
623 | return set_fan_div(dev, buf, count, offset - 1); \ | 623 | return set_fan_div(dev, buf, count, offset - 1); \ |
@@ -633,21 +633,21 @@ show_fan_offset(2); | |||
633 | show_fan_offset(3); | 633 | show_fan_offset(3); |
634 | 634 | ||
635 | #define show_pwm_offset(offset) \ | 635 | #define show_pwm_offset(offset) \ |
636 | static ssize_t show_pwm##offset##_enable (struct device *dev, \ | 636 | static ssize_t show_pwm##offset##_enable (struct device *dev, struct device_attribute *attr, \ |
637 | char *buf) \ | 637 | char *buf) \ |
638 | { \ | 638 | { \ |
639 | return show_pwm_enable(dev, buf, offset - 1); \ | 639 | return show_pwm_enable(dev, buf, offset - 1); \ |
640 | } \ | 640 | } \ |
641 | static ssize_t show_pwm##offset (struct device *dev, char *buf) \ | 641 | static ssize_t show_pwm##offset (struct device *dev, struct device_attribute *attr, char *buf) \ |
642 | { \ | 642 | { \ |
643 | return show_pwm(dev, buf, offset - 1); \ | 643 | return show_pwm(dev, buf, offset - 1); \ |
644 | } \ | 644 | } \ |
645 | static ssize_t set_pwm##offset##_enable (struct device *dev, \ | 645 | static ssize_t set_pwm##offset##_enable (struct device *dev, struct device_attribute *attr, \ |
646 | const char *buf, size_t count) \ | 646 | const char *buf, size_t count) \ |
647 | { \ | 647 | { \ |
648 | return set_pwm_enable(dev, buf, count, offset - 1); \ | 648 | return set_pwm_enable(dev, buf, count, offset - 1); \ |
649 | } \ | 649 | } \ |
650 | static ssize_t set_pwm##offset (struct device *dev, \ | 650 | static ssize_t set_pwm##offset (struct device *dev, struct device_attribute *attr, \ |
651 | const char *buf, size_t count) \ | 651 | const char *buf, size_t count) \ |
652 | { \ | 652 | { \ |
653 | return set_pwm(dev, buf, count, offset - 1); \ | 653 | return set_pwm(dev, buf, count, offset - 1); \ |
@@ -663,7 +663,7 @@ show_pwm_offset(2); | |||
663 | show_pwm_offset(3); | 663 | show_pwm_offset(3); |
664 | 664 | ||
665 | /* Alarms */ | 665 | /* Alarms */ |
666 | static ssize_t show_alarms(struct device *dev, char *buf) | 666 | static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf) |
667 | { | 667 | { |
668 | struct it87_data *data = it87_update_device(dev); | 668 | struct it87_data *data = it87_update_device(dev); |
669 | return sprintf(buf,"%d\n", ALARMS_FROM_REG(data->alarms)); | 669 | return sprintf(buf,"%d\n", ALARMS_FROM_REG(data->alarms)); |
@@ -671,13 +671,13 @@ static ssize_t show_alarms(struct device *dev, char *buf) | |||
671 | static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL); | 671 | static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL); |
672 | 672 | ||
673 | static ssize_t | 673 | static ssize_t |
674 | show_vrm_reg(struct device *dev, char *buf) | 674 | show_vrm_reg(struct device *dev, struct device_attribute *attr, char *buf) |
675 | { | 675 | { |
676 | struct it87_data *data = it87_update_device(dev); | 676 | struct it87_data *data = it87_update_device(dev); |
677 | return sprintf(buf, "%ld\n", (long) data->vrm); | 677 | return sprintf(buf, "%ld\n", (long) data->vrm); |
678 | } | 678 | } |
679 | static ssize_t | 679 | static ssize_t |
680 | store_vrm_reg(struct device *dev, const char *buf, size_t count) | 680 | store_vrm_reg(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) |
681 | { | 681 | { |
682 | struct i2c_client *client = to_i2c_client(dev); | 682 | struct i2c_client *client = to_i2c_client(dev); |
683 | struct it87_data *data = i2c_get_clientdata(client); | 683 | struct it87_data *data = i2c_get_clientdata(client); |
@@ -693,7 +693,7 @@ static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm_reg, store_vrm_reg); | |||
693 | device_create_file(&client->dev, &dev_attr_vrm) | 693 | device_create_file(&client->dev, &dev_attr_vrm) |
694 | 694 | ||
695 | static ssize_t | 695 | static ssize_t |
696 | show_vid_reg(struct device *dev, char *buf) | 696 | show_vid_reg(struct device *dev, struct device_attribute *attr, char *buf) |
697 | { | 697 | { |
698 | struct it87_data *data = it87_update_device(dev); | 698 | struct it87_data *data = it87_update_device(dev); |
699 | return sprintf(buf, "%ld\n", (long) vid_from_reg(data->vid, data->vrm)); | 699 | return sprintf(buf, "%ld\n", (long) vid_from_reg(data->vid, data->vrm)); |
diff --git a/drivers/i2c/chips/lm63.c b/drivers/i2c/chips/lm63.c index 14cc5af03739..bc68e031392b 100644 --- a/drivers/i2c/chips/lm63.c +++ b/drivers/i2c/chips/lm63.c | |||
@@ -177,7 +177,7 @@ struct lm63_data { | |||
177 | */ | 177 | */ |
178 | 178 | ||
179 | #define show_fan(value) \ | 179 | #define show_fan(value) \ |
180 | static ssize_t show_##value(struct device *dev, char *buf) \ | 180 | static ssize_t show_##value(struct device *dev, struct device_attribute *attr, char *buf) \ |
181 | { \ | 181 | { \ |
182 | struct lm63_data *data = lm63_update_device(dev); \ | 182 | struct lm63_data *data = lm63_update_device(dev); \ |
183 | return sprintf(buf, "%d\n", FAN_FROM_REG(data->value)); \ | 183 | return sprintf(buf, "%d\n", FAN_FROM_REG(data->value)); \ |
@@ -185,7 +185,7 @@ static ssize_t show_##value(struct device *dev, char *buf) \ | |||
185 | show_fan(fan1_input); | 185 | show_fan(fan1_input); |
186 | show_fan(fan1_low); | 186 | show_fan(fan1_low); |
187 | 187 | ||
188 | static ssize_t set_fan1_low(struct device *dev, const char *buf, | 188 | static ssize_t set_fan1_low(struct device *dev, struct device_attribute *attr, const char *buf, |
189 | size_t count) | 189 | size_t count) |
190 | { | 190 | { |
191 | struct i2c_client *client = to_i2c_client(dev); | 191 | struct i2c_client *client = to_i2c_client(dev); |
@@ -202,7 +202,7 @@ static ssize_t set_fan1_low(struct device *dev, const char *buf, | |||
202 | return count; | 202 | return count; |
203 | } | 203 | } |
204 | 204 | ||
205 | static ssize_t show_pwm1(struct device *dev, char *buf) | 205 | static ssize_t show_pwm1(struct device *dev, struct device_attribute *attr, char *buf) |
206 | { | 206 | { |
207 | struct lm63_data *data = lm63_update_device(dev); | 207 | struct lm63_data *data = lm63_update_device(dev); |
208 | return sprintf(buf, "%d\n", data->pwm1_value >= 2 * data->pwm1_freq ? | 208 | return sprintf(buf, "%d\n", data->pwm1_value >= 2 * data->pwm1_freq ? |
@@ -210,7 +210,7 @@ static ssize_t show_pwm1(struct device *dev, char *buf) | |||
210 | (2 * data->pwm1_freq)); | 210 | (2 * data->pwm1_freq)); |
211 | } | 211 | } |
212 | 212 | ||
213 | static ssize_t set_pwm1(struct device *dev, const char *buf, size_t count) | 213 | static ssize_t set_pwm1(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) |
214 | { | 214 | { |
215 | struct i2c_client *client = to_i2c_client(dev); | 215 | struct i2c_client *client = to_i2c_client(dev); |
216 | struct lm63_data *data = i2c_get_clientdata(client); | 216 | struct lm63_data *data = i2c_get_clientdata(client); |
@@ -229,20 +229,20 @@ static ssize_t set_pwm1(struct device *dev, const char *buf, size_t count) | |||
229 | return count; | 229 | return count; |
230 | } | 230 | } |
231 | 231 | ||
232 | static ssize_t show_pwm1_enable(struct device *dev, char *buf) | 232 | static ssize_t show_pwm1_enable(struct device *dev, struct device_attribute *attr, char *buf) |
233 | { | 233 | { |
234 | struct lm63_data *data = lm63_update_device(dev); | 234 | struct lm63_data *data = lm63_update_device(dev); |
235 | return sprintf(buf, "%d\n", data->config_fan & 0x20 ? 1 : 2); | 235 | return sprintf(buf, "%d\n", data->config_fan & 0x20 ? 1 : 2); |
236 | } | 236 | } |
237 | 237 | ||
238 | #define show_temp8(value) \ | 238 | #define show_temp8(value) \ |
239 | static ssize_t show_##value(struct device *dev, char *buf) \ | 239 | static ssize_t show_##value(struct device *dev, struct device_attribute *attr, char *buf) \ |
240 | { \ | 240 | { \ |
241 | struct lm63_data *data = lm63_update_device(dev); \ | 241 | struct lm63_data *data = lm63_update_device(dev); \ |
242 | return sprintf(buf, "%d\n", TEMP8_FROM_REG(data->value)); \ | 242 | return sprintf(buf, "%d\n", TEMP8_FROM_REG(data->value)); \ |
243 | } | 243 | } |
244 | #define show_temp11(value) \ | 244 | #define show_temp11(value) \ |
245 | static ssize_t show_##value(struct device *dev, char *buf) \ | 245 | static ssize_t show_##value(struct device *dev, struct device_attribute *attr, char *buf) \ |
246 | { \ | 246 | { \ |
247 | struct lm63_data *data = lm63_update_device(dev); \ | 247 | struct lm63_data *data = lm63_update_device(dev); \ |
248 | return sprintf(buf, "%d\n", TEMP11_FROM_REG(data->value)); \ | 248 | return sprintf(buf, "%d\n", TEMP11_FROM_REG(data->value)); \ |
@@ -255,7 +255,7 @@ show_temp11(temp2_low); | |||
255 | show_temp8(temp2_crit); | 255 | show_temp8(temp2_crit); |
256 | 256 | ||
257 | #define set_temp8(value, reg) \ | 257 | #define set_temp8(value, reg) \ |
258 | static ssize_t set_##value(struct device *dev, const char *buf, \ | 258 | static ssize_t set_##value(struct device *dev, struct device_attribute *attr, const char *buf, \ |
259 | size_t count) \ | 259 | size_t count) \ |
260 | { \ | 260 | { \ |
261 | struct i2c_client *client = to_i2c_client(dev); \ | 261 | struct i2c_client *client = to_i2c_client(dev); \ |
@@ -269,7 +269,7 @@ static ssize_t set_##value(struct device *dev, const char *buf, \ | |||
269 | return count; \ | 269 | return count; \ |
270 | } | 270 | } |
271 | #define set_temp11(value, reg_msb, reg_lsb) \ | 271 | #define set_temp11(value, reg_msb, reg_lsb) \ |
272 | static ssize_t set_##value(struct device *dev, const char *buf, \ | 272 | static ssize_t set_##value(struct device *dev, struct device_attribute *attr, const char *buf, \ |
273 | size_t count) \ | 273 | size_t count) \ |
274 | { \ | 274 | { \ |
275 | struct i2c_client *client = to_i2c_client(dev); \ | 275 | struct i2c_client *client = to_i2c_client(dev); \ |
@@ -289,7 +289,7 @@ set_temp11(temp2_low, LM63_REG_REMOTE_LOW_MSB, LM63_REG_REMOTE_LOW_LSB); | |||
289 | 289 | ||
290 | /* Hysteresis register holds a relative value, while we want to present | 290 | /* Hysteresis register holds a relative value, while we want to present |
291 | an absolute to user-space */ | 291 | an absolute to user-space */ |
292 | static ssize_t show_temp2_crit_hyst(struct device *dev, char *buf) | 292 | static ssize_t show_temp2_crit_hyst(struct device *dev, struct device_attribute *attr, char *buf) |
293 | { | 293 | { |
294 | struct lm63_data *data = lm63_update_device(dev); | 294 | struct lm63_data *data = lm63_update_device(dev); |
295 | return sprintf(buf, "%d\n", TEMP8_FROM_REG(data->temp2_crit) | 295 | return sprintf(buf, "%d\n", TEMP8_FROM_REG(data->temp2_crit) |
@@ -298,7 +298,7 @@ static ssize_t show_temp2_crit_hyst(struct device *dev, char *buf) | |||
298 | 298 | ||
299 | /* And now the other way around, user-space provides an absolute | 299 | /* And now the other way around, user-space provides an absolute |
300 | hysteresis value and we have to store a relative one */ | 300 | hysteresis value and we have to store a relative one */ |
301 | static ssize_t set_temp2_crit_hyst(struct device *dev, const char *buf, | 301 | static ssize_t set_temp2_crit_hyst(struct device *dev, struct device_attribute *attr, const char *buf, |
302 | size_t count) | 302 | size_t count) |
303 | { | 303 | { |
304 | struct i2c_client *client = to_i2c_client(dev); | 304 | struct i2c_client *client = to_i2c_client(dev); |
@@ -314,7 +314,7 @@ static ssize_t set_temp2_crit_hyst(struct device *dev, const char *buf, | |||
314 | return count; | 314 | return count; |
315 | } | 315 | } |
316 | 316 | ||
317 | static ssize_t show_alarms(struct device *dev, char *buf) | 317 | static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf) |
318 | { | 318 | { |
319 | struct lm63_data *data = lm63_update_device(dev); | 319 | struct lm63_data *data = lm63_update_device(dev); |
320 | return sprintf(buf, "%u\n", data->alarms); | 320 | return sprintf(buf, "%u\n", data->alarms); |
diff --git a/drivers/i2c/chips/lm75.c b/drivers/i2c/chips/lm75.c index 0e86cc893981..57c51ac37c04 100644 --- a/drivers/i2c/chips/lm75.c +++ b/drivers/i2c/chips/lm75.c | |||
@@ -75,7 +75,7 @@ static struct i2c_driver lm75_driver = { | |||
75 | }; | 75 | }; |
76 | 76 | ||
77 | #define show(value) \ | 77 | #define show(value) \ |
78 | static ssize_t show_##value(struct device *dev, char *buf) \ | 78 | static ssize_t show_##value(struct device *dev, struct device_attribute *attr, char *buf) \ |
79 | { \ | 79 | { \ |
80 | struct lm75_data *data = lm75_update_device(dev); \ | 80 | struct lm75_data *data = lm75_update_device(dev); \ |
81 | return sprintf(buf, "%d\n", LM75_TEMP_FROM_REG(data->value)); \ | 81 | return sprintf(buf, "%d\n", LM75_TEMP_FROM_REG(data->value)); \ |
@@ -85,7 +85,7 @@ show(temp_hyst); | |||
85 | show(temp_input); | 85 | show(temp_input); |
86 | 86 | ||
87 | #define set(value, reg) \ | 87 | #define set(value, reg) \ |
88 | static ssize_t set_##value(struct device *dev, const char *buf, size_t count) \ | 88 | static ssize_t set_##value(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \ |
89 | { \ | 89 | { \ |
90 | struct i2c_client *client = to_i2c_client(dev); \ | 90 | struct i2c_client *client = to_i2c_client(dev); \ |
91 | struct lm75_data *data = i2c_get_clientdata(client); \ | 91 | struct lm75_data *data = i2c_get_clientdata(client); \ |