Skip to content

Commit 0f56413

Browse files
aleksamagickagroeck
authored andcommitted
hwmon: (aquacomputer_d5next) Check if temp sensors of legacy devices are connected
Return -ENODATA if a temp sensor of a legacy device does not contain a reading. Originally-from: Leonard Anderweit <[email protected]> Signed-off-by: Aleksa Savic <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
1 parent ceaa224 commit 0f56413

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/hwmon/aquacomputer_d5next.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -953,7 +953,10 @@ static int aqc_legacy_read(struct aqc_data *priv)
953953
for (i = 0; i < priv->num_temp_sensors; i++) {
954954
sensor_value = get_unaligned_le16(priv->buffer + priv->temp_sensor_start_offset +
955955
i * AQC_SENSOR_SIZE);
956-
priv->temp_input[i] = sensor_value * 10;
956+
if (sensor_value == AQC_SENSOR_NA)
957+
priv->temp_input[i] = -ENODATA;
958+
else
959+
priv->temp_input[i] = sensor_value * 10;
957960
}
958961

959962
/* Special-case sensor readings */

0 commit comments

Comments
 (0)