diff options
author | Guenter Roeck <linux@roeck-us.net> | 2018-12-10 17:02:06 -0500 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2018-12-16 18:13:46 -0500 |
commit | 626f5eaed15ab81e9ece29d3dc1cf9e5881110f3 (patch) | |
tree | 837243d601fb54e13029c0fa4c93cb85999609e9 /drivers/hwmon/ftsteutates.c | |
parent | 22ed7883c138ee5f7c8eec3c12f494f8bd59d8fe (diff) |
hwmon: (ftsteutates) Use permission specific SENSOR[_DEVICE]_ATTR variants
Use SENSOR[_DEVICE]_ATTR[_2]_{RO,RW,WO} to simplify the source code,
to improve readbility, and to reduce the chance of inconsistencies.
Also replace any remaining S_<PERMS> in the driver with octal values.
The conversion was done automatically with coccinelle. The semantic patches
and the scripts used to generate this commit log are available at
https://github.com/groeck/coccinelle-patches/hwmon/.
This patch does not introduce functional changes. It was verified by
compiling the old and new files and comparing text and data sizes.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/ftsteutates.c')
-rw-r--r-- | drivers/hwmon/ftsteutates.c | 202 |
1 files changed, 89 insertions, 113 deletions
diff --git a/drivers/hwmon/ftsteutates.c b/drivers/hwmon/ftsteutates.c index 0801f48a41f7..ca8f4481264b 100644 --- a/drivers/hwmon/ftsteutates.c +++ b/drivers/hwmon/ftsteutates.c | |||
@@ -352,7 +352,7 @@ static int fts_watchdog_init(struct fts_data *data) | |||
352 | /*****************************************************************************/ | 352 | /*****************************************************************************/ |
353 | /* SysFS handler functions */ | 353 | /* SysFS handler functions */ |
354 | /*****************************************************************************/ | 354 | /*****************************************************************************/ |
355 | static ssize_t show_in_value(struct device *dev, | 355 | static ssize_t in_value_show(struct device *dev, |
356 | struct device_attribute *devattr, char *buf) | 356 | struct device_attribute *devattr, char *buf) |
357 | { | 357 | { |
358 | struct fts_data *data = dev_get_drvdata(dev); | 358 | struct fts_data *data = dev_get_drvdata(dev); |
@@ -366,7 +366,7 @@ static ssize_t show_in_value(struct device *dev, | |||
366 | return sprintf(buf, "%u\n", data->volt[index]); | 366 | return sprintf(buf, "%u\n", data->volt[index]); |
367 | } | 367 | } |
368 | 368 | ||
369 | static ssize_t show_temp_value(struct device *dev, | 369 | static ssize_t temp_value_show(struct device *dev, |
370 | struct device_attribute *devattr, char *buf) | 370 | struct device_attribute *devattr, char *buf) |
371 | { | 371 | { |
372 | struct fts_data *data = dev_get_drvdata(dev); | 372 | struct fts_data *data = dev_get_drvdata(dev); |
@@ -380,7 +380,7 @@ static ssize_t show_temp_value(struct device *dev, | |||
380 | return sprintf(buf, "%u\n", data->temp_input[index]); | 380 | return sprintf(buf, "%u\n", data->temp_input[index]); |
381 | } | 381 | } |
382 | 382 | ||
383 | static ssize_t show_temp_fault(struct device *dev, | 383 | static ssize_t temp_fault_show(struct device *dev, |
384 | struct device_attribute *devattr, char *buf) | 384 | struct device_attribute *devattr, char *buf) |
385 | { | 385 | { |
386 | struct fts_data *data = dev_get_drvdata(dev); | 386 | struct fts_data *data = dev_get_drvdata(dev); |
@@ -395,7 +395,7 @@ static ssize_t show_temp_fault(struct device *dev, | |||
395 | return sprintf(buf, "%d\n", data->temp_input[index] == 0); | 395 | return sprintf(buf, "%d\n", data->temp_input[index] == 0); |
396 | } | 396 | } |
397 | 397 | ||
398 | static ssize_t show_temp_alarm(struct device *dev, | 398 | static ssize_t temp_alarm_show(struct device *dev, |
399 | struct device_attribute *devattr, char *buf) | 399 | struct device_attribute *devattr, char *buf) |
400 | { | 400 | { |
401 | struct fts_data *data = dev_get_drvdata(dev); | 401 | struct fts_data *data = dev_get_drvdata(dev); |
@@ -410,7 +410,7 @@ static ssize_t show_temp_alarm(struct device *dev, | |||
410 | } | 410 | } |
411 | 411 | ||
412 | static ssize_t | 412 | static ssize_t |
413 | clear_temp_alarm(struct device *dev, struct device_attribute *devattr, | 413 | temp_alarm_store(struct device *dev, struct device_attribute *devattr, |
414 | const char *buf, size_t count) | 414 | const char *buf, size_t count) |
415 | { | 415 | { |
416 | struct fts_data *data = dev_get_drvdata(dev); | 416 | struct fts_data *data = dev_get_drvdata(dev); |
@@ -441,7 +441,7 @@ error: | |||
441 | return ret; | 441 | return ret; |
442 | } | 442 | } |
443 | 443 | ||
444 | static ssize_t show_fan_value(struct device *dev, | 444 | static ssize_t fan_value_show(struct device *dev, |
445 | struct device_attribute *devattr, char *buf) | 445 | struct device_attribute *devattr, char *buf) |
446 | { | 446 | { |
447 | struct fts_data *data = dev_get_drvdata(dev); | 447 | struct fts_data *data = dev_get_drvdata(dev); |
@@ -455,7 +455,7 @@ static ssize_t show_fan_value(struct device *dev, | |||
455 | return sprintf(buf, "%u\n", data->fan_input[index]); | 455 | return sprintf(buf, "%u\n", data->fan_input[index]); |
456 | } | 456 | } |
457 | 457 | ||
458 | static ssize_t show_fan_source(struct device *dev, | 458 | static ssize_t fan_source_show(struct device *dev, |
459 | struct device_attribute *devattr, char *buf) | 459 | struct device_attribute *devattr, char *buf) |
460 | { | 460 | { |
461 | struct fts_data *data = dev_get_drvdata(dev); | 461 | struct fts_data *data = dev_get_drvdata(dev); |
@@ -469,7 +469,7 @@ static ssize_t show_fan_source(struct device *dev, | |||
469 | return sprintf(buf, "%u\n", data->fan_source[index]); | 469 | return sprintf(buf, "%u\n", data->fan_source[index]); |
470 | } | 470 | } |
471 | 471 | ||
472 | static ssize_t show_fan_alarm(struct device *dev, | 472 | static ssize_t fan_alarm_show(struct device *dev, |
473 | struct device_attribute *devattr, char *buf) | 473 | struct device_attribute *devattr, char *buf) |
474 | { | 474 | { |
475 | struct fts_data *data = dev_get_drvdata(dev); | 475 | struct fts_data *data = dev_get_drvdata(dev); |
@@ -484,7 +484,7 @@ static ssize_t show_fan_alarm(struct device *dev, | |||
484 | } | 484 | } |
485 | 485 | ||
486 | static ssize_t | 486 | static ssize_t |
487 | clear_fan_alarm(struct device *dev, struct device_attribute *devattr, | 487 | fan_alarm_store(struct device *dev, struct device_attribute *devattr, |
488 | const char *buf, size_t count) | 488 | const char *buf, size_t count) |
489 | { | 489 | { |
490 | struct fts_data *data = dev_get_drvdata(dev); | 490 | struct fts_data *data = dev_get_drvdata(dev); |
@@ -520,72 +520,56 @@ error: | |||
520 | /*****************************************************************************/ | 520 | /*****************************************************************************/ |
521 | 521 | ||
522 | /* Temprature sensors */ | 522 | /* Temprature sensors */ |
523 | static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, show_temp_value, NULL, 0); | 523 | static SENSOR_DEVICE_ATTR_RO(temp1_input, temp_value, 0); |
524 | static SENSOR_DEVICE_ATTR(temp2_input, S_IRUGO, show_temp_value, NULL, 1); | 524 | static SENSOR_DEVICE_ATTR_RO(temp2_input, temp_value, 1); |
525 | static SENSOR_DEVICE_ATTR(temp3_input, S_IRUGO, show_temp_value, NULL, 2); | 525 | static SENSOR_DEVICE_ATTR_RO(temp3_input, temp_value, 2); |
526 | static SENSOR_DEVICE_ATTR(temp4_input, S_IRUGO, show_temp_value, NULL, 3); | 526 | static SENSOR_DEVICE_ATTR_RO(temp4_input, temp_value, 3); |
527 | static SENSOR_DEVICE_ATTR(temp5_input, S_IRUGO, show_temp_value, NULL, 4); | 527 | static SENSOR_DEVICE_ATTR_RO(temp5_input, temp_value, 4); |
528 | static SENSOR_DEVICE_ATTR(temp6_input, S_IRUGO, show_temp_value, NULL, 5); | 528 | static SENSOR_DEVICE_ATTR_RO(temp6_input, temp_value, 5); |
529 | static SENSOR_DEVICE_ATTR(temp7_input, S_IRUGO, show_temp_value, NULL, 6); | 529 | static SENSOR_DEVICE_ATTR_RO(temp7_input, temp_value, 6); |
530 | static SENSOR_DEVICE_ATTR(temp8_input, S_IRUGO, show_temp_value, NULL, 7); | 530 | static SENSOR_DEVICE_ATTR_RO(temp8_input, temp_value, 7); |
531 | static SENSOR_DEVICE_ATTR(temp9_input, S_IRUGO, show_temp_value, NULL, 8); | 531 | static SENSOR_DEVICE_ATTR_RO(temp9_input, temp_value, 8); |
532 | static SENSOR_DEVICE_ATTR(temp10_input, S_IRUGO, show_temp_value, NULL, 9); | 532 | static SENSOR_DEVICE_ATTR_RO(temp10_input, temp_value, 9); |
533 | static SENSOR_DEVICE_ATTR(temp11_input, S_IRUGO, show_temp_value, NULL, 10); | 533 | static SENSOR_DEVICE_ATTR_RO(temp11_input, temp_value, 10); |
534 | static SENSOR_DEVICE_ATTR(temp12_input, S_IRUGO, show_temp_value, NULL, 11); | 534 | static SENSOR_DEVICE_ATTR_RO(temp12_input, temp_value, 11); |
535 | static SENSOR_DEVICE_ATTR(temp13_input, S_IRUGO, show_temp_value, NULL, 12); | 535 | static SENSOR_DEVICE_ATTR_RO(temp13_input, temp_value, 12); |
536 | static SENSOR_DEVICE_ATTR(temp14_input, S_IRUGO, show_temp_value, NULL, 13); | 536 | static SENSOR_DEVICE_ATTR_RO(temp14_input, temp_value, 13); |
537 | static SENSOR_DEVICE_ATTR(temp15_input, S_IRUGO, show_temp_value, NULL, 14); | 537 | static SENSOR_DEVICE_ATTR_RO(temp15_input, temp_value, 14); |
538 | static SENSOR_DEVICE_ATTR(temp16_input, S_IRUGO, show_temp_value, NULL, 15); | 538 | static SENSOR_DEVICE_ATTR_RO(temp16_input, temp_value, 15); |
539 | 539 | ||
540 | static SENSOR_DEVICE_ATTR(temp1_fault, S_IRUGO, show_temp_fault, NULL, 0); | 540 | static SENSOR_DEVICE_ATTR_RO(temp1_fault, temp_fault, 0); |
541 | static SENSOR_DEVICE_ATTR(temp2_fault, S_IRUGO, show_temp_fault, NULL, 1); | 541 | static SENSOR_DEVICE_ATTR_RO(temp2_fault, temp_fault, 1); |
542 | static SENSOR_DEVICE_ATTR(temp3_fault, S_IRUGO, show_temp_fault, NULL, 2); | 542 | static SENSOR_DEVICE_ATTR_RO(temp3_fault, temp_fault, 2); |
543 | static SENSOR_DEVICE_ATTR(temp4_fault, S_IRUGO, show_temp_fault, NULL, 3); | 543 | static SENSOR_DEVICE_ATTR_RO(temp4_fault, temp_fault, 3); |
544 | static SENSOR_DEVICE_ATTR(temp5_fault, S_IRUGO, show_temp_fault, NULL, 4); | 544 | static SENSOR_DEVICE_ATTR_RO(temp5_fault, temp_fault, 4); |
545 | static SENSOR_DEVICE_ATTR(temp6_fault, S_IRUGO, show_temp_fault, NULL, 5); | 545 | static SENSOR_DEVICE_ATTR_RO(temp6_fault, temp_fault, 5); |
546 | static SENSOR_DEVICE_ATTR(temp7_fault, S_IRUGO, show_temp_fault, NULL, 6); | 546 | static SENSOR_DEVICE_ATTR_RO(temp7_fault, temp_fault, 6); |
547 | static SENSOR_DEVICE_ATTR(temp8_fault, S_IRUGO, show_temp_fault, NULL, 7); | 547 | static SENSOR_DEVICE_ATTR_RO(temp8_fault, temp_fault, 7); |
548 | static SENSOR_DEVICE_ATTR(temp9_fault, S_IRUGO, show_temp_fault, NULL, 8); | 548 | static SENSOR_DEVICE_ATTR_RO(temp9_fault, temp_fault, 8); |
549 | static SENSOR_DEVICE_ATTR(temp10_fault, S_IRUGO, show_temp_fault, NULL, 9); | 549 | static SENSOR_DEVICE_ATTR_RO(temp10_fault, temp_fault, 9); |
550 | static SENSOR_DEVICE_ATTR(temp11_fault, S_IRUGO, show_temp_fault, NULL, 10); | 550 | static SENSOR_DEVICE_ATTR_RO(temp11_fault, temp_fault, 10); |
551 | static SENSOR_DEVICE_ATTR(temp12_fault, S_IRUGO, show_temp_fault, NULL, 11); | 551 | static SENSOR_DEVICE_ATTR_RO(temp12_fault, temp_fault, 11); |
552 | static SENSOR_DEVICE_ATTR(temp13_fault, S_IRUGO, show_temp_fault, NULL, 12); | 552 | static SENSOR_DEVICE_ATTR_RO(temp13_fault, temp_fault, 12); |
553 | static SENSOR_DEVICE_ATTR(temp14_fault, S_IRUGO, show_temp_fault, NULL, 13); | 553 | static SENSOR_DEVICE_ATTR_RO(temp14_fault, temp_fault, 13); |
554 | static SENSOR_DEVICE_ATTR(temp15_fault, S_IRUGO, show_temp_fault, NULL, 14); | 554 | static SENSOR_DEVICE_ATTR_RO(temp15_fault, temp_fault, 14); |
555 | static SENSOR_DEVICE_ATTR(temp16_fault, S_IRUGO, show_temp_fault, NULL, 15); | 555 | static SENSOR_DEVICE_ATTR_RO(temp16_fault, temp_fault, 15); |
556 | 556 | ||
557 | static SENSOR_DEVICE_ATTR(temp1_alarm, S_IRUGO | S_IWUSR, show_temp_alarm, | 557 | static SENSOR_DEVICE_ATTR_RW(temp1_alarm, temp_alarm, 0); |
558 | clear_temp_alarm, 0); | 558 | static SENSOR_DEVICE_ATTR_RW(temp2_alarm, temp_alarm, 1); |
559 | static SENSOR_DEVICE_ATTR(temp2_alarm, S_IRUGO | S_IWUSR, show_temp_alarm, | 559 | static SENSOR_DEVICE_ATTR_RW(temp3_alarm, temp_alarm, 2); |
560 | clear_temp_alarm, 1); | 560 | static SENSOR_DEVICE_ATTR_RW(temp4_alarm, temp_alarm, 3); |
561 | static SENSOR_DEVICE_ATTR(temp3_alarm, S_IRUGO | S_IWUSR, show_temp_alarm, | 561 | static SENSOR_DEVICE_ATTR_RW(temp5_alarm, temp_alarm, 4); |
562 | clear_temp_alarm, 2); | 562 | static SENSOR_DEVICE_ATTR_RW(temp6_alarm, temp_alarm, 5); |
563 | static SENSOR_DEVICE_ATTR(temp4_alarm, S_IRUGO | S_IWUSR, show_temp_alarm, | 563 | static SENSOR_DEVICE_ATTR_RW(temp7_alarm, temp_alarm, 6); |
564 | clear_temp_alarm, 3); | 564 | static SENSOR_DEVICE_ATTR_RW(temp8_alarm, temp_alarm, 7); |
565 | static SENSOR_DEVICE_ATTR(temp5_alarm, S_IRUGO | S_IWUSR, show_temp_alarm, | 565 | static SENSOR_DEVICE_ATTR_RW(temp9_alarm, temp_alarm, 8); |
566 | clear_temp_alarm, 4); | 566 | static SENSOR_DEVICE_ATTR_RW(temp10_alarm, temp_alarm, 9); |
567 | static SENSOR_DEVICE_ATTR(temp6_alarm, S_IRUGO | S_IWUSR, show_temp_alarm, | 567 | static SENSOR_DEVICE_ATTR_RW(temp11_alarm, temp_alarm, 10); |
568 | clear_temp_alarm, 5); | 568 | static SENSOR_DEVICE_ATTR_RW(temp12_alarm, temp_alarm, 11); |
569 | static SENSOR_DEVICE_ATTR(temp7_alarm, S_IRUGO | S_IWUSR, show_temp_alarm, | 569 | static SENSOR_DEVICE_ATTR_RW(temp13_alarm, temp_alarm, 12); |
570 | clear_temp_alarm, 6); | 570 | static SENSOR_DEVICE_ATTR_RW(temp14_alarm, temp_alarm, 13); |
571 | static SENSOR_DEVICE_ATTR(temp8_alarm, S_IRUGO | S_IWUSR, show_temp_alarm, | 571 | static SENSOR_DEVICE_ATTR_RW(temp15_alarm, temp_alarm, 14); |
572 | clear_temp_alarm, 7); | 572 | static SENSOR_DEVICE_ATTR_RW(temp16_alarm, temp_alarm, 15); |
573 | static SENSOR_DEVICE_ATTR(temp9_alarm, S_IRUGO | S_IWUSR, show_temp_alarm, | ||
574 | clear_temp_alarm, 8); | ||
575 | static SENSOR_DEVICE_ATTR(temp10_alarm, S_IRUGO | S_IWUSR, show_temp_alarm, | ||
576 | clear_temp_alarm, 9); | ||
577 | static SENSOR_DEVICE_ATTR(temp11_alarm, S_IRUGO | S_IWUSR, show_temp_alarm, | ||
578 | clear_temp_alarm, 10); | ||
579 | static SENSOR_DEVICE_ATTR(temp12_alarm, S_IRUGO | S_IWUSR, show_temp_alarm, | ||
580 | clear_temp_alarm, 11); | ||
581 | static SENSOR_DEVICE_ATTR(temp13_alarm, S_IRUGO | S_IWUSR, show_temp_alarm, | ||
582 | clear_temp_alarm, 12); | ||
583 | static SENSOR_DEVICE_ATTR(temp14_alarm, S_IRUGO | S_IWUSR, show_temp_alarm, | ||
584 | clear_temp_alarm, 13); | ||
585 | static SENSOR_DEVICE_ATTR(temp15_alarm, S_IRUGO | S_IWUSR, show_temp_alarm, | ||
586 | clear_temp_alarm, 14); | ||
587 | static SENSOR_DEVICE_ATTR(temp16_alarm, S_IRUGO | S_IWUSR, show_temp_alarm, | ||
588 | clear_temp_alarm, 15); | ||
589 | 573 | ||
590 | static struct attribute *fts_temp_attrs[] = { | 574 | static struct attribute *fts_temp_attrs[] = { |
591 | &sensor_dev_attr_temp1_input.dev_attr.attr, | 575 | &sensor_dev_attr_temp1_input.dev_attr.attr, |
@@ -642,40 +626,32 @@ static struct attribute *fts_temp_attrs[] = { | |||
642 | }; | 626 | }; |
643 | 627 | ||
644 | /* Fans */ | 628 | /* Fans */ |
645 | static SENSOR_DEVICE_ATTR(fan1_input, S_IRUGO, show_fan_value, NULL, 0); | 629 | static SENSOR_DEVICE_ATTR_RO(fan1_input, fan_value, 0); |
646 | static SENSOR_DEVICE_ATTR(fan2_input, S_IRUGO, show_fan_value, NULL, 1); | 630 | static SENSOR_DEVICE_ATTR_RO(fan2_input, fan_value, 1); |
647 | static SENSOR_DEVICE_ATTR(fan3_input, S_IRUGO, show_fan_value, NULL, 2); | 631 | static SENSOR_DEVICE_ATTR_RO(fan3_input, fan_value, 2); |
648 | static SENSOR_DEVICE_ATTR(fan4_input, S_IRUGO, show_fan_value, NULL, 3); | 632 | static SENSOR_DEVICE_ATTR_RO(fan4_input, fan_value, 3); |
649 | static SENSOR_DEVICE_ATTR(fan5_input, S_IRUGO, show_fan_value, NULL, 4); | 633 | static SENSOR_DEVICE_ATTR_RO(fan5_input, fan_value, 4); |
650 | static SENSOR_DEVICE_ATTR(fan6_input, S_IRUGO, show_fan_value, NULL, 5); | 634 | static SENSOR_DEVICE_ATTR_RO(fan6_input, fan_value, 5); |
651 | static SENSOR_DEVICE_ATTR(fan7_input, S_IRUGO, show_fan_value, NULL, 6); | 635 | static SENSOR_DEVICE_ATTR_RO(fan7_input, fan_value, 6); |
652 | static SENSOR_DEVICE_ATTR(fan8_input, S_IRUGO, show_fan_value, NULL, 7); | 636 | static SENSOR_DEVICE_ATTR_RO(fan8_input, fan_value, 7); |
653 | 637 | ||
654 | static SENSOR_DEVICE_ATTR(fan1_source, S_IRUGO, show_fan_source, NULL, 0); | 638 | static SENSOR_DEVICE_ATTR_RO(fan1_source, fan_source, 0); |
655 | static SENSOR_DEVICE_ATTR(fan2_source, S_IRUGO, show_fan_source, NULL, 1); | 639 | static SENSOR_DEVICE_ATTR_RO(fan2_source, fan_source, 1); |
656 | static SENSOR_DEVICE_ATTR(fan3_source, S_IRUGO, show_fan_source, NULL, 2); | 640 | static SENSOR_DEVICE_ATTR_RO(fan3_source, fan_source, 2); |
657 | static SENSOR_DEVICE_ATTR(fan4_source, S_IRUGO, show_fan_source, NULL, 3); | 641 | static SENSOR_DEVICE_ATTR_RO(fan4_source, fan_source, 3); |
658 | static SENSOR_DEVICE_ATTR(fan5_source, S_IRUGO, show_fan_source, NULL, 4); | 642 | static SENSOR_DEVICE_ATTR_RO(fan5_source, fan_source, 4); |
659 | static SENSOR_DEVICE_ATTR(fan6_source, S_IRUGO, show_fan_source, NULL, 5); | 643 | static SENSOR_DEVICE_ATTR_RO(fan6_source, fan_source, 5); |
660 | static SENSOR_DEVICE_ATTR(fan7_source, S_IRUGO, show_fan_source, NULL, 6); | 644 | static SENSOR_DEVICE_ATTR_RO(fan7_source, fan_source, 6); |
661 | static SENSOR_DEVICE_ATTR(fan8_source, S_IRUGO, show_fan_source, NULL, 7); | 645 | static SENSOR_DEVICE_ATTR_RO(fan8_source, fan_source, 7); |
662 | 646 | ||
663 | static SENSOR_DEVICE_ATTR(fan1_alarm, S_IRUGO | S_IWUSR, | 647 | static SENSOR_DEVICE_ATTR_RW(fan1_alarm, fan_alarm, 0); |
664 | show_fan_alarm, clear_fan_alarm, 0); | 648 | static SENSOR_DEVICE_ATTR_RW(fan2_alarm, fan_alarm, 1); |
665 | static SENSOR_DEVICE_ATTR(fan2_alarm, S_IRUGO | S_IWUSR, | 649 | static SENSOR_DEVICE_ATTR_RW(fan3_alarm, fan_alarm, 2); |
666 | show_fan_alarm, clear_fan_alarm, 1); | 650 | static SENSOR_DEVICE_ATTR_RW(fan4_alarm, fan_alarm, 3); |
667 | static SENSOR_DEVICE_ATTR(fan3_alarm, S_IRUGO | S_IWUSR, | 651 | static SENSOR_DEVICE_ATTR_RW(fan5_alarm, fan_alarm, 4); |
668 | show_fan_alarm, clear_fan_alarm, 2); | 652 | static SENSOR_DEVICE_ATTR_RW(fan6_alarm, fan_alarm, 5); |
669 | static SENSOR_DEVICE_ATTR(fan4_alarm, S_IRUGO | S_IWUSR, | 653 | static SENSOR_DEVICE_ATTR_RW(fan7_alarm, fan_alarm, 6); |
670 | show_fan_alarm, clear_fan_alarm, 3); | 654 | static SENSOR_DEVICE_ATTR_RW(fan8_alarm, fan_alarm, 7); |
671 | static SENSOR_DEVICE_ATTR(fan5_alarm, S_IRUGO | S_IWUSR, | ||
672 | show_fan_alarm, clear_fan_alarm, 4); | ||
673 | static SENSOR_DEVICE_ATTR(fan6_alarm, S_IRUGO | S_IWUSR, | ||
674 | show_fan_alarm, clear_fan_alarm, 5); | ||
675 | static SENSOR_DEVICE_ATTR(fan7_alarm, S_IRUGO | S_IWUSR, | ||
676 | show_fan_alarm, clear_fan_alarm, 6); | ||
677 | static SENSOR_DEVICE_ATTR(fan8_alarm, S_IRUGO | S_IWUSR, | ||
678 | show_fan_alarm, clear_fan_alarm, 7); | ||
679 | 655 | ||
680 | static struct attribute *fts_fan_attrs[] = { | 656 | static struct attribute *fts_fan_attrs[] = { |
681 | &sensor_dev_attr_fan1_input.dev_attr.attr, | 657 | &sensor_dev_attr_fan1_input.dev_attr.attr, |
@@ -708,10 +684,10 @@ static struct attribute *fts_fan_attrs[] = { | |||
708 | }; | 684 | }; |
709 | 685 | ||
710 | /* Voltages */ | 686 | /* Voltages */ |
711 | static SENSOR_DEVICE_ATTR(in1_input, S_IRUGO, show_in_value, NULL, 0); | 687 | static SENSOR_DEVICE_ATTR_RO(in1_input, in_value, 0); |
712 | static SENSOR_DEVICE_ATTR(in2_input, S_IRUGO, show_in_value, NULL, 1); | 688 | static SENSOR_DEVICE_ATTR_RO(in2_input, in_value, 1); |
713 | static SENSOR_DEVICE_ATTR(in3_input, S_IRUGO, show_in_value, NULL, 2); | 689 | static SENSOR_DEVICE_ATTR_RO(in3_input, in_value, 2); |
714 | static SENSOR_DEVICE_ATTR(in4_input, S_IRUGO, show_in_value, NULL, 3); | 690 | static SENSOR_DEVICE_ATTR_RO(in4_input, in_value, 3); |
715 | static struct attribute *fts_voltage_attrs[] = { | 691 | static struct attribute *fts_voltage_attrs[] = { |
716 | &sensor_dev_attr_in1_input.dev_attr.attr, | 692 | &sensor_dev_attr_in1_input.dev_attr.attr, |
717 | &sensor_dev_attr_in2_input.dev_attr.attr, | 693 | &sensor_dev_attr_in2_input.dev_attr.attr, |