Commit 0f564130 authored by Aleksa Savic's avatar Aleksa Savic Committed by Guenter Roeck

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 <leonard.anderweit@gmail.com>
Signed-off-by: default avatarAleksa Savic <savicaleksa83@gmail.com>
Link: https://lore.kernel.org/r/20231016083559.139341-2-savicaleksa83@gmail.comSigned-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent ceaa2240
......@@ -953,7 +953,10 @@ static int aqc_legacy_read(struct aqc_data *priv)
for (i = 0; i < priv->num_temp_sensors; i++) {
sensor_value = get_unaligned_le16(priv->buffer + priv->temp_sensor_start_offset +
i * AQC_SENSOR_SIZE);
priv->temp_input[i] = sensor_value * 10;
if (sensor_value == AQC_SENSOR_NA)
priv->temp_input[i] = -ENODATA;
else
priv->temp_input[i] = sensor_value * 10;
}
/* Special-case sensor readings */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment