]> Git Repo - linux.git/commitdiff
hwmon: (aquacomputer_d5next) Check if temp sensors of legacy devices are connected
authorAleksa Savic <[email protected]>
Mon, 16 Oct 2023 08:35:57 +0000 (10:35 +0200)
committerGuenter Roeck <[email protected]>
Mon, 30 Oct 2023 05:22:48 +0000 (22:22 -0700)
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]>
drivers/hwmon/aquacomputer_d5next.c

index 0378edd52134d1b25a9174e646cce3cfc2b09d66..4fdd2e12427b9dfa2d1c8f62914cb9657efb07ac 100644 (file)
@@ -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 */
This page took 0.059861 seconds and 4 git commands to generate.