Skip to content

Commit 5f348fa

Browse files
Stefan Schaeckelergroeck
Stefan Schaeckeler
authored andcommitted
hwmon: (aspeed-pwm-tacho) make fan/pwm names start with index 1
Make fan and pwm names in sysfs start with index 1 in accordance to Documentation/hwmon/sysfs-interface conventions. Current implementation starts with index 0, making tools such as sensors(1) skip the first fan. Signed-off-by: Stefan Schaeckeler <sschaeck@cisco.com> Fixes: 2d7a548 ("drivers: hwmon: Support for ASPEED PWM/Fan tach") Signed-off-by: Guenter Roeck <linux@roeck-us.net>
1 parent 4d58e73 commit 5f348fa

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

drivers/hwmon/aspeed-pwm-tacho.c

+26-26
Original file line numberDiff line numberDiff line change
@@ -597,31 +597,31 @@ static umode_t fan_dev_is_visible(struct kobject *kobj,
597597
return a->mode;
598598
}
599599

600-
static SENSOR_DEVICE_ATTR(pwm0, 0644,
601-
show_pwm, set_pwm, 0);
602600
static SENSOR_DEVICE_ATTR(pwm1, 0644,
603-
show_pwm, set_pwm, 1);
601+
show_pwm, set_pwm, 0);
604602
static SENSOR_DEVICE_ATTR(pwm2, 0644,
605-
show_pwm, set_pwm, 2);
603+
show_pwm, set_pwm, 1);
606604
static SENSOR_DEVICE_ATTR(pwm3, 0644,
607-
show_pwm, set_pwm, 3);
605+
show_pwm, set_pwm, 2);
608606
static SENSOR_DEVICE_ATTR(pwm4, 0644,
609-
show_pwm, set_pwm, 4);
607+
show_pwm, set_pwm, 3);
610608
static SENSOR_DEVICE_ATTR(pwm5, 0644,
611-
show_pwm, set_pwm, 5);
609+
show_pwm, set_pwm, 4);
612610
static SENSOR_DEVICE_ATTR(pwm6, 0644,
613-
show_pwm, set_pwm, 6);
611+
show_pwm, set_pwm, 5);
614612
static SENSOR_DEVICE_ATTR(pwm7, 0644,
613+
show_pwm, set_pwm, 6);
614+
static SENSOR_DEVICE_ATTR(pwm8, 0644,
615615
show_pwm, set_pwm, 7);
616616
static struct attribute *pwm_dev_attrs[] = {
617-
&sensor_dev_attr_pwm0.dev_attr.attr,
618617
&sensor_dev_attr_pwm1.dev_attr.attr,
619618
&sensor_dev_attr_pwm2.dev_attr.attr,
620619
&sensor_dev_attr_pwm3.dev_attr.attr,
621620
&sensor_dev_attr_pwm4.dev_attr.attr,
622621
&sensor_dev_attr_pwm5.dev_attr.attr,
623622
&sensor_dev_attr_pwm6.dev_attr.attr,
624623
&sensor_dev_attr_pwm7.dev_attr.attr,
624+
&sensor_dev_attr_pwm8.dev_attr.attr,
625625
NULL,
626626
};
627627

@@ -630,40 +630,39 @@ static const struct attribute_group pwm_dev_group = {
630630
.is_visible = pwm_is_visible,
631631
};
632632

633-
static SENSOR_DEVICE_ATTR(fan0_input, 0444,
634-
show_rpm, NULL, 0);
635633
static SENSOR_DEVICE_ATTR(fan1_input, 0444,
636-
show_rpm, NULL, 1);
634+
show_rpm, NULL, 0);
637635
static SENSOR_DEVICE_ATTR(fan2_input, 0444,
638-
show_rpm, NULL, 2);
636+
show_rpm, NULL, 1);
639637
static SENSOR_DEVICE_ATTR(fan3_input, 0444,
640-
show_rpm, NULL, 3);
638+
show_rpm, NULL, 2);
641639
static SENSOR_DEVICE_ATTR(fan4_input, 0444,
642-
show_rpm, NULL, 4);
640+
show_rpm, NULL, 3);
643641
static SENSOR_DEVICE_ATTR(fan5_input, 0444,
644-
show_rpm, NULL, 5);
642+
show_rpm, NULL, 4);
645643
static SENSOR_DEVICE_ATTR(fan6_input, 0444,
646-
show_rpm, NULL, 6);
644+
show_rpm, NULL, 5);
647645
static SENSOR_DEVICE_ATTR(fan7_input, 0444,
648-
show_rpm, NULL, 7);
646+
show_rpm, NULL, 6);
649647
static SENSOR_DEVICE_ATTR(fan8_input, 0444,
650-
show_rpm, NULL, 8);
648+
show_rpm, NULL, 7);
651649
static SENSOR_DEVICE_ATTR(fan9_input, 0444,
652-
show_rpm, NULL, 9);
650+
show_rpm, NULL, 8);
653651
static SENSOR_DEVICE_ATTR(fan10_input, 0444,
654-
show_rpm, NULL, 10);
652+
show_rpm, NULL, 9);
655653
static SENSOR_DEVICE_ATTR(fan11_input, 0444,
656-
show_rpm, NULL, 11);
654+
show_rpm, NULL, 10);
657655
static SENSOR_DEVICE_ATTR(fan12_input, 0444,
658-
show_rpm, NULL, 12);
656+
show_rpm, NULL, 11);
659657
static SENSOR_DEVICE_ATTR(fan13_input, 0444,
660-
show_rpm, NULL, 13);
658+
show_rpm, NULL, 12);
661659
static SENSOR_DEVICE_ATTR(fan14_input, 0444,
662-
show_rpm, NULL, 14);
660+
show_rpm, NULL, 13);
663661
static SENSOR_DEVICE_ATTR(fan15_input, 0444,
662+
show_rpm, NULL, 14);
663+
static SENSOR_DEVICE_ATTR(fan16_input, 0444,
664664
show_rpm, NULL, 15);
665665
static struct attribute *fan_dev_attrs[] = {
666-
&sensor_dev_attr_fan0_input.dev_attr.attr,
667666
&sensor_dev_attr_fan1_input.dev_attr.attr,
668667
&sensor_dev_attr_fan2_input.dev_attr.attr,
669668
&sensor_dev_attr_fan3_input.dev_attr.attr,
@@ -679,6 +678,7 @@ static struct attribute *fan_dev_attrs[] = {
679678
&sensor_dev_attr_fan13_input.dev_attr.attr,
680679
&sensor_dev_attr_fan14_input.dev_attr.attr,
681680
&sensor_dev_attr_fan15_input.dev_attr.attr,
681+
&sensor_dev_attr_fan16_input.dev_attr.attr,
682682
NULL
683683
};
684684

0 commit comments

Comments
 (0)