summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2018-12-10 17:02:06 -0500
committerGuenter Roeck <linux@roeck-us.net>2018-12-16 18:13:45 -0500
commit22ed7883c138ee5f7c8eec3c12f494f8bd59d8fe (patch)
tree138229a69245dfef7941608eb1d2df99b9e2e6b7
parent7a61d7197b8eb43fdbc036cd0eeea44986267202 (diff)
hwmon: (fschmd) 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>
-rw-r--r--drivers/hwmon/fschmd.c235
1 files changed, 116 insertions, 119 deletions
diff --git a/drivers/hwmon/fschmd.c b/drivers/hwmon/fschmd.c
index 22d3a84f13ef..042a166e1858 100644
--- a/drivers/hwmon/fschmd.c
+++ b/drivers/hwmon/fschmd.c
@@ -331,8 +331,8 @@ static void fschmd_release_resources(struct kref *ref)
331 * Sysfs attr show / store functions 331 * Sysfs attr show / store functions
332 */ 332 */
333 333
334static ssize_t show_in_value(struct device *dev, 334static ssize_t in_value_show(struct device *dev,
335 struct device_attribute *devattr, char *buf) 335 struct device_attribute *devattr, char *buf)
336{ 336{
337 const int max_reading[3] = { 14200, 6600, 3300 }; 337 const int max_reading[3] = { 14200, 6600, 3300 };
338 int index = to_sensor_dev_attr(devattr)->index; 338 int index = to_sensor_dev_attr(devattr)->index;
@@ -349,8 +349,8 @@ static ssize_t show_in_value(struct device *dev,
349 349
350#define TEMP_FROM_REG(val) (((val) - 128) * 1000) 350#define TEMP_FROM_REG(val) (((val) - 128) * 1000)
351 351
352static ssize_t show_temp_value(struct device *dev, 352static ssize_t temp_value_show(struct device *dev,
353 struct device_attribute *devattr, char *buf) 353 struct device_attribute *devattr, char *buf)
354{ 354{
355 int index = to_sensor_dev_attr(devattr)->index; 355 int index = to_sensor_dev_attr(devattr)->index;
356 struct fschmd_data *data = fschmd_update_device(dev); 356 struct fschmd_data *data = fschmd_update_device(dev);
@@ -358,8 +358,8 @@ static ssize_t show_temp_value(struct device *dev,
358 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_act[index])); 358 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_act[index]));
359} 359}
360 360
361static ssize_t show_temp_max(struct device *dev, 361static ssize_t temp_max_show(struct device *dev,
362 struct device_attribute *devattr, char *buf) 362 struct device_attribute *devattr, char *buf)
363{ 363{
364 int index = to_sensor_dev_attr(devattr)->index; 364 int index = to_sensor_dev_attr(devattr)->index;
365 struct fschmd_data *data = fschmd_update_device(dev); 365 struct fschmd_data *data = fschmd_update_device(dev);
@@ -367,8 +367,9 @@ static ssize_t show_temp_max(struct device *dev,
367 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_max[index])); 367 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_max[index]));
368} 368}
369 369
370static ssize_t store_temp_max(struct device *dev, struct device_attribute 370static ssize_t temp_max_store(struct device *dev,
371 *devattr, const char *buf, size_t count) 371 struct device_attribute *devattr,
372 const char *buf, size_t count)
372{ 373{
373 int index = to_sensor_dev_attr(devattr)->index; 374 int index = to_sensor_dev_attr(devattr)->index;
374 struct fschmd_data *data = dev_get_drvdata(dev); 375 struct fschmd_data *data = dev_get_drvdata(dev);
@@ -390,8 +391,8 @@ static ssize_t store_temp_max(struct device *dev, struct device_attribute
390 return count; 391 return count;
391} 392}
392 393
393static ssize_t show_temp_fault(struct device *dev, 394static ssize_t temp_fault_show(struct device *dev,
394 struct device_attribute *devattr, char *buf) 395 struct device_attribute *devattr, char *buf)
395{ 396{
396 int index = to_sensor_dev_attr(devattr)->index; 397 int index = to_sensor_dev_attr(devattr)->index;
397 struct fschmd_data *data = fschmd_update_device(dev); 398 struct fschmd_data *data = fschmd_update_device(dev);
@@ -403,8 +404,8 @@ static ssize_t show_temp_fault(struct device *dev,
403 return sprintf(buf, "1\n"); 404 return sprintf(buf, "1\n");
404} 405}
405 406
406static ssize_t show_temp_alarm(struct device *dev, 407static ssize_t temp_alarm_show(struct device *dev,
407 struct device_attribute *devattr, char *buf) 408 struct device_attribute *devattr, char *buf)
408{ 409{
409 int index = to_sensor_dev_attr(devattr)->index; 410 int index = to_sensor_dev_attr(devattr)->index;
410 struct fschmd_data *data = fschmd_update_device(dev); 411 struct fschmd_data *data = fschmd_update_device(dev);
@@ -419,8 +420,8 @@ static ssize_t show_temp_alarm(struct device *dev,
419 420
420#define RPM_FROM_REG(val) ((val) * 60) 421#define RPM_FROM_REG(val) ((val) * 60)
421 422
422static ssize_t show_fan_value(struct device *dev, 423static ssize_t fan_value_show(struct device *dev,
423 struct device_attribute *devattr, char *buf) 424 struct device_attribute *devattr, char *buf)
424{ 425{
425 int index = to_sensor_dev_attr(devattr)->index; 426 int index = to_sensor_dev_attr(devattr)->index;
426 struct fschmd_data *data = fschmd_update_device(dev); 427 struct fschmd_data *data = fschmd_update_device(dev);
@@ -428,8 +429,8 @@ static ssize_t show_fan_value(struct device *dev,
428 return sprintf(buf, "%u\n", RPM_FROM_REG(data->fan_act[index])); 429 return sprintf(buf, "%u\n", RPM_FROM_REG(data->fan_act[index]));
429} 430}
430 431
431static ssize_t show_fan_div(struct device *dev, 432static ssize_t fan_div_show(struct device *dev,
432 struct device_attribute *devattr, char *buf) 433 struct device_attribute *devattr, char *buf)
433{ 434{
434 int index = to_sensor_dev_attr(devattr)->index; 435 int index = to_sensor_dev_attr(devattr)->index;
435 struct fschmd_data *data = fschmd_update_device(dev); 436 struct fschmd_data *data = fschmd_update_device(dev);
@@ -438,8 +439,9 @@ static ssize_t show_fan_div(struct device *dev,
438 return sprintf(buf, "%d\n", 1 << (data->fan_ripple[index] & 3)); 439 return sprintf(buf, "%d\n", 1 << (data->fan_ripple[index] & 3));
439} 440}
440 441
441static ssize_t store_fan_div(struct device *dev, struct device_attribute 442static ssize_t fan_div_store(struct device *dev,
442 *devattr, const char *buf, size_t count) 443 struct device_attribute *devattr,
444 const char *buf, size_t count)
443{ 445{
444 u8 reg; 446 u8 reg;
445 int index = to_sensor_dev_attr(devattr)->index; 447 int index = to_sensor_dev_attr(devattr)->index;
@@ -488,8 +490,8 @@ static ssize_t store_fan_div(struct device *dev, struct device_attribute
488 return count; 490 return count;
489} 491}
490 492
491static ssize_t show_fan_alarm(struct device *dev, 493static ssize_t fan_alarm_show(struct device *dev,
492 struct device_attribute *devattr, char *buf) 494 struct device_attribute *devattr, char *buf)
493{ 495{
494 int index = to_sensor_dev_attr(devattr)->index; 496 int index = to_sensor_dev_attr(devattr)->index;
495 struct fschmd_data *data = fschmd_update_device(dev); 497 struct fschmd_data *data = fschmd_update_device(dev);
@@ -500,8 +502,8 @@ static ssize_t show_fan_alarm(struct device *dev,
500 return sprintf(buf, "0\n"); 502 return sprintf(buf, "0\n");
501} 503}
502 504
503static ssize_t show_fan_fault(struct device *dev, 505static ssize_t fan_fault_show(struct device *dev,
504 struct device_attribute *devattr, char *buf) 506 struct device_attribute *devattr, char *buf)
505{ 507{
506 int index = to_sensor_dev_attr(devattr)->index; 508 int index = to_sensor_dev_attr(devattr)->index;
507 struct fschmd_data *data = fschmd_update_device(dev); 509 struct fschmd_data *data = fschmd_update_device(dev);
@@ -513,8 +515,9 @@ static ssize_t show_fan_fault(struct device *dev,
513} 515}
514 516
515 517
516static ssize_t show_pwm_auto_point1_pwm(struct device *dev, 518static ssize_t pwm_auto_point1_pwm_show(struct device *dev,
517 struct device_attribute *devattr, char *buf) 519 struct device_attribute *devattr,
520 char *buf)
518{ 521{
519 int index = to_sensor_dev_attr(devattr)->index; 522 int index = to_sensor_dev_attr(devattr)->index;
520 struct fschmd_data *data = fschmd_update_device(dev); 523 struct fschmd_data *data = fschmd_update_device(dev);
@@ -527,8 +530,9 @@ static ssize_t show_pwm_auto_point1_pwm(struct device *dev,
527 return sprintf(buf, "%d\n", val); 530 return sprintf(buf, "%d\n", val);
528} 531}
529 532
530static ssize_t store_pwm_auto_point1_pwm(struct device *dev, 533static ssize_t pwm_auto_point1_pwm_store(struct device *dev,
531 struct device_attribute *devattr, const char *buf, size_t count) 534 struct device_attribute *devattr,
535 const char *buf, size_t count)
532{ 536{
533 int index = to_sensor_dev_attr(devattr)->index; 537 int index = to_sensor_dev_attr(devattr)->index;
534 struct fschmd_data *data = dev_get_drvdata(dev); 538 struct fschmd_data *data = dev_get_drvdata(dev);
@@ -605,104 +609,97 @@ static ssize_t alert_led_store(struct device *dev,
605static DEVICE_ATTR_RW(alert_led); 609static DEVICE_ATTR_RW(alert_led);
606 610
607static struct sensor_device_attribute fschmd_attr[] = { 611static struct sensor_device_attribute fschmd_attr[] = {
608 SENSOR_ATTR(in0_input, 0444, show_in_value, NULL, 0), 612 SENSOR_ATTR_RO(in0_input, in_value, 0),
609 SENSOR_ATTR(in1_input, 0444, show_in_value, NULL, 1), 613 SENSOR_ATTR_RO(in1_input, in_value, 1),
610 SENSOR_ATTR(in2_input, 0444, show_in_value, NULL, 2), 614 SENSOR_ATTR_RO(in2_input, in_value, 2),
611 SENSOR_ATTR(in3_input, 0444, show_in_value, NULL, 3), 615 SENSOR_ATTR_RO(in3_input, in_value, 3),
612 SENSOR_ATTR(in4_input, 0444, show_in_value, NULL, 4), 616 SENSOR_ATTR_RO(in4_input, in_value, 4),
613 SENSOR_ATTR(in5_input, 0444, show_in_value, NULL, 5), 617 SENSOR_ATTR_RO(in5_input, in_value, 5),
614}; 618};
615 619
616static struct sensor_device_attribute fschmd_temp_attr[] = { 620static struct sensor_device_attribute fschmd_temp_attr[] = {
617 SENSOR_ATTR(temp1_input, 0444, show_temp_value, NULL, 0), 621 SENSOR_ATTR_RO(temp1_input, temp_value, 0),
618 SENSOR_ATTR(temp1_max, 0644, show_temp_max, store_temp_max, 0), 622 SENSOR_ATTR_RW(temp1_max, temp_max, 0),
619 SENSOR_ATTR(temp1_fault, 0444, show_temp_fault, NULL, 0), 623 SENSOR_ATTR_RO(temp1_fault, temp_fault, 0),
620 SENSOR_ATTR(temp1_alarm, 0444, show_temp_alarm, NULL, 0), 624 SENSOR_ATTR_RO(temp1_alarm, temp_alarm, 0),
621 SENSOR_ATTR(temp2_input, 0444, show_temp_value, NULL, 1), 625 SENSOR_ATTR_RO(temp2_input, temp_value, 1),
622 SENSOR_ATTR(temp2_max, 0644, show_temp_max, store_temp_max, 1), 626 SENSOR_ATTR_RW(temp2_max, temp_max, 1),
623 SENSOR_ATTR(temp2_fault, 0444, show_temp_fault, NULL, 1), 627 SENSOR_ATTR_RO(temp2_fault, temp_fault, 1),
624 SENSOR_ATTR(temp2_alarm, 0444, show_temp_alarm, NULL, 1), 628 SENSOR_ATTR_RO(temp2_alarm, temp_alarm, 1),
625 SENSOR_ATTR(temp3_input, 0444, show_temp_value, NULL, 2), 629 SENSOR_ATTR_RO(temp3_input, temp_value, 2),
626 SENSOR_ATTR(temp3_max, 0644, show_temp_max, store_temp_max, 2), 630 SENSOR_ATTR_RW(temp3_max, temp_max, 2),
627 SENSOR_ATTR(temp3_fault, 0444, show_temp_fault, NULL, 2), 631 SENSOR_ATTR_RO(temp3_fault, temp_fault, 2),
628 SENSOR_ATTR(temp3_alarm, 0444, show_temp_alarm, NULL, 2), 632 SENSOR_ATTR_RO(temp3_alarm, temp_alarm, 2),
629 SENSOR_ATTR(temp4_input, 0444, show_temp_value, NULL, 3), 633 SENSOR_ATTR_RO(temp4_input, temp_value, 3),
630 SENSOR_ATTR(temp4_max, 0644, show_temp_max, store_temp_max, 3), 634 SENSOR_ATTR_RW(temp4_max, temp_max, 3),
631 SENSOR_ATTR(temp4_fault, 0444, show_temp_fault, NULL, 3), 635 SENSOR_ATTR_RO(temp4_fault, temp_fault, 3),
632 SENSOR_ATTR(temp4_alarm, 0444, show_temp_alarm, NULL, 3), 636 SENSOR_ATTR_RO(temp4_alarm, temp_alarm, 3),
633 SENSOR_ATTR(temp5_input, 0444, show_temp_value, NULL, 4), 637 SENSOR_ATTR_RO(temp5_input, temp_value, 4),
634 SENSOR_ATTR(temp5_max, 0644, show_temp_max, store_temp_max, 4), 638 SENSOR_ATTR_RW(temp5_max, temp_max, 4),
635 SENSOR_ATTR(temp5_fault, 0444, show_temp_fault, NULL, 4), 639 SENSOR_ATTR_RO(temp5_fault, temp_fault, 4),
636 SENSOR_ATTR(temp5_alarm, 0444, show_temp_alarm, NULL, 4), 640 SENSOR_ATTR_RO(temp5_alarm, temp_alarm, 4),
637 SENSOR_ATTR(temp6_input, 0444, show_temp_value, NULL, 5), 641 SENSOR_ATTR_RO(temp6_input, temp_value, 5),
638 SENSOR_ATTR(temp6_max, 0644, show_temp_max, store_temp_max, 5), 642 SENSOR_ATTR_RW(temp6_max, temp_max, 5),
639 SENSOR_ATTR(temp6_fault, 0444, show_temp_fault, NULL, 5), 643 SENSOR_ATTR_RO(temp6_fault, temp_fault, 5),
640 SENSOR_ATTR(temp6_alarm, 0444, show_temp_alarm, NULL, 5), 644 SENSOR_ATTR_RO(temp6_alarm, temp_alarm, 5),
641 SENSOR_ATTR(temp7_input, 0444, show_temp_value, NULL, 6), 645 SENSOR_ATTR_RO(temp7_input, temp_value, 6),
642 SENSOR_ATTR(temp7_max, 0644, show_temp_max, store_temp_max, 6), 646 SENSOR_ATTR_RW(temp7_max, temp_max, 6),
643 SENSOR_ATTR(temp7_fault, 0444, show_temp_fault, NULL, 6), 647 SENSOR_ATTR_RO(temp7_fault, temp_fault, 6),
644 SENSOR_ATTR(temp7_alarm, 0444, show_temp_alarm, NULL, 6), 648 SENSOR_ATTR_RO(temp7_alarm, temp_alarm, 6),
645 SENSOR_ATTR(temp8_input, 0444, show_temp_value, NULL, 7), 649 SENSOR_ATTR_RO(temp8_input, temp_value, 7),
646 SENSOR_ATTR(temp8_max, 0644, show_temp_max, store_temp_max, 7), 650 SENSOR_ATTR_RW(temp8_max, temp_max, 7),
647 SENSOR_ATTR(temp8_fault, 0444, show_temp_fault, NULL, 7), 651 SENSOR_ATTR_RO(temp8_fault, temp_fault, 7),
648 SENSOR_ATTR(temp8_alarm, 0444, show_temp_alarm, NULL, 7), 652 SENSOR_ATTR_RO(temp8_alarm, temp_alarm, 7),
649 SENSOR_ATTR(temp9_input, 0444, show_temp_value, NULL, 8), 653 SENSOR_ATTR_RO(temp9_input, temp_value, 8),
650 SENSOR_ATTR(temp9_max, 0644, show_temp_max, store_temp_max, 8), 654 SENSOR_ATTR_RW(temp9_max, temp_max, 8),
651 SENSOR_ATTR(temp9_fault, 0444, show_temp_fault, NULL, 8), 655 SENSOR_ATTR_RO(temp9_fault, temp_fault, 8),
652 SENSOR_ATTR(temp9_alarm, 0444, show_temp_alarm, NULL, 8), 656 SENSOR_ATTR_RO(temp9_alarm, temp_alarm, 8),
653 SENSOR_ATTR(temp10_input, 0444, show_temp_value, NULL, 9), 657 SENSOR_ATTR_RO(temp10_input, temp_value, 9),
654 SENSOR_ATTR(temp10_max, 0644, show_temp_max, store_temp_max, 9), 658 SENSOR_ATTR_RW(temp10_max, temp_max, 9),
655 SENSOR_ATTR(temp10_fault, 0444, show_temp_fault, NULL, 9), 659 SENSOR_ATTR_RO(temp10_fault, temp_fault, 9),
656 SENSOR_ATTR(temp10_alarm, 0444, show_temp_alarm, NULL, 9), 660 SENSOR_ATTR_RO(temp10_alarm, temp_alarm, 9),
657 SENSOR_ATTR(temp11_input, 0444, show_temp_value, NULL, 10), 661 SENSOR_ATTR_RO(temp11_input, temp_value, 10),
658 SENSOR_ATTR(temp11_max, 0644, show_temp_max, store_temp_max, 10), 662 SENSOR_ATTR_RW(temp11_max, temp_max, 10),
659 SENSOR_ATTR(temp11_fault, 0444, show_temp_fault, NULL, 10), 663 SENSOR_ATTR_RO(temp11_fault, temp_fault, 10),
660 SENSOR_ATTR(temp11_alarm, 0444, show_temp_alarm, NULL, 10), 664 SENSOR_ATTR_RO(temp11_alarm, temp_alarm, 10),
661}; 665};
662 666
663static struct sensor_device_attribute fschmd_fan_attr[] = { 667static struct sensor_device_attribute fschmd_fan_attr[] = {
664 SENSOR_ATTR(fan1_input, 0444, show_fan_value, NULL, 0), 668 SENSOR_ATTR_RO(fan1_input, fan_value, 0),
665 SENSOR_ATTR(fan1_div, 0644, show_fan_div, store_fan_div, 0), 669 SENSOR_ATTR_RW(fan1_div, fan_div, 0),
666 SENSOR_ATTR(fan1_alarm, 0444, show_fan_alarm, NULL, 0), 670 SENSOR_ATTR_RO(fan1_alarm, fan_alarm, 0),
667 SENSOR_ATTR(fan1_fault, 0444, show_fan_fault, NULL, 0), 671 SENSOR_ATTR_RO(fan1_fault, fan_fault, 0),
668 SENSOR_ATTR(pwm1_auto_point1_pwm, 0644, show_pwm_auto_point1_pwm, 672 SENSOR_ATTR_RW(pwm1_auto_point1_pwm, pwm_auto_point1_pwm, 0),
669 store_pwm_auto_point1_pwm, 0), 673 SENSOR_ATTR_RO(fan2_input, fan_value, 1),
670 SENSOR_ATTR(fan2_input, 0444, show_fan_value, NULL, 1), 674 SENSOR_ATTR_RW(fan2_div, fan_div, 1),
671 SENSOR_ATTR(fan2_div, 0644, show_fan_div, store_fan_div, 1), 675 SENSOR_ATTR_RO(fan2_alarm, fan_alarm, 1),
672 SENSOR_ATTR(fan2_alarm, 0444, show_fan_alarm, NULL, 1), 676 SENSOR_ATTR_RO(fan2_fault, fan_fault, 1),
673 SENSOR_ATTR(fan2_fault, 0444, show_fan_fault, NULL, 1), 677 SENSOR_ATTR_RW(pwm2_auto_point1_pwm, pwm_auto_point1_pwm, 1),
674 SENSOR_ATTR(pwm2_auto_point1_pwm, 0644, show_pwm_auto_point1_pwm, 678 SENSOR_ATTR_RO(fan3_input, fan_value, 2),
675 store_pwm_auto_point1_pwm, 1), 679 SENSOR_ATTR_RW(fan3_div, fan_div, 2),
676 SENSOR_ATTR(fan3_input, 0444, show_fan_value, NULL, 2), 680 SENSOR_ATTR_RO(fan3_alarm, fan_alarm, 2),
677 SENSOR_ATTR(fan3_div, 0644, show_fan_div, store_fan_div, 2), 681 SENSOR_ATTR_RO(fan3_fault, fan_fault, 2),
678 SENSOR_ATTR(fan3_alarm, 0444, show_fan_alarm, NULL, 2), 682 SENSOR_ATTR_RW(pwm3_auto_point1_pwm, pwm_auto_point1_pwm, 2),
679 SENSOR_ATTR(fan3_fault, 0444, show_fan_fault, NULL, 2), 683 SENSOR_ATTR_RO(fan4_input, fan_value, 3),
680 SENSOR_ATTR(pwm3_auto_point1_pwm, 0644, show_pwm_auto_point1_pwm, 684 SENSOR_ATTR_RW(fan4_div, fan_div, 3),
681 store_pwm_auto_point1_pwm, 2), 685 SENSOR_ATTR_RO(fan4_alarm, fan_alarm, 3),
682 SENSOR_ATTR(fan4_input, 0444, show_fan_value, NULL, 3), 686 SENSOR_ATTR_RO(fan4_fault, fan_fault, 3),
683 SENSOR_ATTR(fan4_div, 0644, show_fan_div, store_fan_div, 3), 687 SENSOR_ATTR_RW(pwm4_auto_point1_pwm, pwm_auto_point1_pwm, 3),
684 SENSOR_ATTR(fan4_alarm, 0444, show_fan_alarm, NULL, 3), 688 SENSOR_ATTR_RO(fan5_input, fan_value, 4),
685 SENSOR_ATTR(fan4_fault, 0444, show_fan_fault, NULL, 3), 689 SENSOR_ATTR_RW(fan5_div, fan_div, 4),
686 SENSOR_ATTR(pwm4_auto_point1_pwm, 0644, show_pwm_auto_point1_pwm, 690 SENSOR_ATTR_RO(fan5_alarm, fan_alarm, 4),
687 store_pwm_auto_point1_pwm, 3), 691 SENSOR_ATTR_RO(fan5_fault, fan_fault, 4),
688 SENSOR_ATTR(fan5_input, 0444, show_fan_value, NULL, 4), 692 SENSOR_ATTR_RW(pwm5_auto_point1_pwm, pwm_auto_point1_pwm, 4),
689 SENSOR_ATTR(fan5_div, 0644, show_fan_div, store_fan_div, 4), 693 SENSOR_ATTR_RO(fan6_input, fan_value, 5),
690 SENSOR_ATTR(fan5_alarm, 0444, show_fan_alarm, NULL, 4), 694 SENSOR_ATTR_RW(fan6_div, fan_div, 5),
691 SENSOR_ATTR(fan5_fault, 0444, show_fan_fault, NULL, 4), 695 SENSOR_ATTR_RO(fan6_alarm, fan_alarm, 5),
692 SENSOR_ATTR(pwm5_auto_point1_pwm, 0644, show_pwm_auto_point1_pwm, 696 SENSOR_ATTR_RO(fan6_fault, fan_fault, 5),
693 store_pwm_auto_point1_pwm, 4), 697 SENSOR_ATTR_RW(pwm6_auto_point1_pwm, pwm_auto_point1_pwm, 5),
694 SENSOR_ATTR(fan6_input, 0444, show_fan_value, NULL, 5), 698 SENSOR_ATTR_RO(fan7_input, fan_value, 6),
695 SENSOR_ATTR(fan6_div, 0644, show_fan_div, store_fan_div, 5), 699 SENSOR_ATTR_RW(fan7_div, fan_div, 6),
696 SENSOR_ATTR(fan6_alarm, 0444, show_fan_alarm, NULL, 5), 700 SENSOR_ATTR_RO(fan7_alarm, fan_alarm, 6),
697 SENSOR_ATTR(fan6_fault, 0444, show_fan_fault, NULL, 5), 701 SENSOR_ATTR_RO(fan7_fault, fan_fault, 6),
698 SENSOR_ATTR(pwm6_auto_point1_pwm, 0644, show_pwm_auto_point1_pwm, 702 SENSOR_ATTR_RW(pwm7_auto_point1_pwm, pwm_auto_point1_pwm, 6),
699 store_pwm_auto_point1_pwm, 5),
700 SENSOR_ATTR(fan7_input, 0444, show_fan_value, NULL, 6),
701 SENSOR_ATTR(fan7_div, 0644, show_fan_div, store_fan_div, 6),
702 SENSOR_ATTR(fan7_alarm, 0444, show_fan_alarm, NULL, 6),
703 SENSOR_ATTR(fan7_fault, 0444, show_fan_fault, NULL, 6),
704 SENSOR_ATTR(pwm7_auto_point1_pwm, 0644, show_pwm_auto_point1_pwm,
705 store_pwm_auto_point1_pwm, 6),
706}; 703};
707 704
708 705
@@ -1169,7 +1166,7 @@ static int fschmd_probe(struct i2c_client *client,
1169 for (i = 0; i < (FSCHMD_NO_TEMP_SENSORS[data->kind] * 4); i++) { 1166 for (i = 0; i < (FSCHMD_NO_TEMP_SENSORS[data->kind] * 4); i++) {
1170 /* Poseidon doesn't have TEMP_LIMIT registers */ 1167 /* Poseidon doesn't have TEMP_LIMIT registers */
1171 if (kind == fscpos && fschmd_temp_attr[i].dev_attr.show == 1168 if (kind == fscpos && fschmd_temp_attr[i].dev_attr.show ==
1172 show_temp_max) 1169 temp_max_show)
1173 continue; 1170 continue;
1174 1171
1175 if (kind == fscsyl) { 1172 if (kind == fscsyl) {