diff options
author | Aleksa Savic <savicaleksa83@gmail.com> | 2023-10-16 11:35:57 +0300 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2023-10-30 08:22:48 +0300 |
commit | 0f564130e5c76f1e5cf0008924f6a6cd138929d9 (patch) | |
tree | 5b9caf21571087027b603873555dabe4f16aa015 /drivers/hwmon/aquacomputer_d5next.c | |
parent | ceaa22402e44e09ab34840a3a83888f93785c772 (diff) | |
download | linux-0f564130e5c76f1e5cf0008924f6a6cd138929d9.tar.xz |
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: Aleksa Savic <savicaleksa83@gmail.com>
Link: https://lore.kernel.org/r/20231016083559.139341-2-savicaleksa83@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/aquacomputer_d5next.c')
-rw-r--r-- | drivers/hwmon/aquacomputer_d5next.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/hwmon/aquacomputer_d5next.c b/drivers/hwmon/aquacomputer_d5next.c index 0378edd52134..4fdd2e12427b 100644 --- a/drivers/hwmon/aquacomputer_d5next.c +++ b/drivers/hwmon/aquacomputer_d5next.c @@ -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 */ |