mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-10-23 11:54:33 +00:00
sysfs: Specific match has to go before generic match
This is not really a problem when the specific scaling factors happen to
be for factors not matched by a generic match but this may not hold in
general over time.
Fixes: 1bd92120 ("Fill the magnitude field of dynamically generated device entries.")
This commit is contained in:
1 parent
aa87b54d43
commit
b76cd8a5f6
1 file changed
+12
-10
+12
-10
@@ -141,6 +141,17 @@ char sensors_sysfs_mount[NAME_MAX];
|
||||
static
|
||||
int get_type_scaling(sensors_subfeature_type type)
|
||||
{
|
||||
/* Multipliers for second class subfeatures
|
||||
that need their own multiplier */
|
||||
switch (type) {
|
||||
case SENSORS_SUBFEATURE_POWER_AVERAGE_INTERVAL:
|
||||
case SENSORS_SUBFEATURE_VID:
|
||||
case SENSORS_SUBFEATURE_TEMP_OFFSET:
|
||||
return 1000;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
/* Multipliers for subfeatures */
|
||||
switch (type & 0xFF80) {
|
||||
case SENSORS_SUBFEATURE_IN_INPUT:
|
||||
@@ -157,16 +168,7 @@ int get_type_scaling(sensors_subfeature_type type)
|
||||
return 1000000;
|
||||
}
|
||||
|
||||
/* Multipliers for second class subfeatures
|
||||
that need their own multiplier */
|
||||
switch (type) {
|
||||
case SENSORS_SUBFEATURE_POWER_AVERAGE_INTERVAL:
|
||||
case SENSORS_SUBFEATURE_VID:
|
||||
case SENSORS_SUBFEATURE_TEMP_OFFSET:
|
||||
return 1000;
|
||||
default:
|
||||
return 1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static
|
||||
|
||||
Reference in new issue
Block a user