Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2359112rdg; Mon, 16 Oct 2023 01:38:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGycXMYlQb0sN6fJRCrftS4Isu5j3f5WIvxWFbfL99kTrGdkfxlyuv8izjr9RIFWbwv5Ne0 X-Received: by 2002:a05:6359:7296:b0:166:abbb:eabe with SMTP id uw22-20020a056359729600b00166abbbeabemr4500925rwb.1.1697445523660; Mon, 16 Oct 2023 01:38:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697445523; cv=none; d=google.com; s=arc-20160816; b=H5TPFgW7Cyzo9B+Xd7wLhYFsOKZ+jmHuqsHTV3OhW6TY6W9u5uHCpXQw9uj8dJF91X BTklkCZmdSu3o1DaPPsJozSQZ5djxxGTYoSm9S+36Zj4xMhIqOE5ONpfIYK0cqfmibyA SyCiv8G6g4KRhcsyNS0dddREY97/ciS8PPaLiEtony8xIlcOGks+voYTjAGuuT/OVw+L TF+rPZ4yjqgTaTP0XaZoSNzere1VswoUS/U2wgAtO4xNnc73hjUJo0P6fRTjv2D/MuXq Qrd82NOios3Z9DSEDZGr7nKVA3FiKZfoDi+68gmYBnwYy9WbEaQnJrBL4MKbO+weSyji nIAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=uLWwUsKeJ2H5tqYiWTlrMLno6gfKUXxQsmHCjrzmZcs=; fh=jVfC5y9HvxUpPXsjgEUzN6Gy1m3u5D6D9dKX/OObWJE=; b=MTfz6XK3ZjvKbyjVLZguO1NQwPn0RcOLolp+sHlsyCEoQ92W8Eq8kDPdLjE6MUBIs1 no6FG67/1TM+Xg05XqpqupFuwGLig2D5W/xE2gG8BInpSdEfCd7FzvWuMpo3mTqPNRm9 h+FRD5Muif/Hpx9pjN+ctlwcY8gpiBWGCJZ90EhZ5HVcPe4mmnvDszSkYXMaZiyzKaCN 3n8M9wv/4q+aaYuzpRv+XyBl7yIj170+MfY95v2rgJr+D/1xVP9aF67r7orpvZ/8EK8d Dps2Pf0Ec98/wlNBLPvspnr019jj5y6ZHaK0oI3pjcwzWf3JZf6YH5VSft4gj1Dpoixv 33TA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Bb9oERYk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id g18-20020a056a000b9200b006bc3f09ea03si4521270pfj.301.2023.10.16.01.38.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 01:38:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Bb9oERYk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 6FFD8805794C; Mon, 16 Oct 2023 01:38:40 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232243AbjJPIiZ (ORCPT + 99 others); Mon, 16 Oct 2023 04:38:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232087AbjJPIiU (ORCPT ); Mon, 16 Oct 2023 04:38:20 -0400 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47AD8DC; Mon, 16 Oct 2023 01:38:18 -0700 (PDT) Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-40651a72807so40696495e9.1; Mon, 16 Oct 2023 01:38:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697445496; x=1698050296; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uLWwUsKeJ2H5tqYiWTlrMLno6gfKUXxQsmHCjrzmZcs=; b=Bb9oERYk9qVUBsFJrz7IiRKMATCNzokIXXJr/gtVkOsoLl00sLmva8QQYXY79EWkTK Fe2akupNvDf3taw6zjpweUx0rsxZ0qEBYB3ywosoWy3YZ4PHuTEkSmxagmBdGITTMn0s ++h8PDTh5mQc/U6Owu/TlQvYdAd27AFznef0BLP9HcbBZjGWs9XoIRwPs6EwvXs0v8bV zoQ03ajGESiw8TmaRGkQWM0uoysJhBG82A4DraPvaCifsHTtBRQcUDXBNjhJf8QFPpve JmW8s/+zs+/wmedBfmeuMkVSJTKcQbtNC69FGziJGycHHVVXIdCwzGFCTSyu8HXcGa+y F9VA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697445496; x=1698050296; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uLWwUsKeJ2H5tqYiWTlrMLno6gfKUXxQsmHCjrzmZcs=; b=KyFqdM6KQsOV0ar5f5loXuDHFxoG2/tmqvtyDHjlexTy5qAJZElm0KEu0pvEkYMGF0 qTxGkQ0Kulyb2KgiyjbCqq0CkAwGj0pQyUnidgTfvPWi/MnSnvSGwI/NtqSKxKYU7tsC zOvhndjVIbmIazef0DGkCTJsxnbMckvjpUyn3ZRGWzIUJQSBWypKRjvHC7XEBiNfcEKq dIEyh9JiqHEU1let78JtRKPpdtPIkE776FK+eo8xEbqjKXm8sKIVu4d6K8/2Ry4nE7js iYvbD1SSvmCucG++LYFHfqXBiNHGkW83sWgshHO5VF8w18MQYEcfh4AV9E1P4uayH2lr GExQ== X-Gm-Message-State: AOJu0YztjPxtLrOGqlm+7DFgOmE+gEWVbUzevieqM134NNIZ/n59e4wR 3RIDEzAXF0WKPF/YHXR/vDmdUfmNPYy8yA== X-Received: by 2002:a7b:c387:0:b0:3f9:b430:199b with SMTP id s7-20020a7bc387000000b003f9b430199bmr28779907wmj.15.1697445496139; Mon, 16 Oct 2023 01:38:16 -0700 (PDT) Received: from fedora.. (cable-178-148-234-71.dynamic.sbb.rs. [178.148.234.71]) by smtp.gmail.com with ESMTPSA id p20-20020a05600c469400b004067e905f44sm6633554wmo.9.2023.10.16.01.38.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 01:38:15 -0700 (PDT) From: Aleksa Savic To: linux-hwmon@vger.kernel.org Cc: leonard.anderweit@gmail.com, Aleksa Savic , Jack Doan , Jean Delvare , Guenter Roeck , Jonathan Corbet , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] hwmon: (aquacomputer_d5next) Check if temp sensors of legacy devices are connected Date: Mon, 16 Oct 2023 10:35:57 +0200 Message-ID: <20231016083559.139341-2-savicaleksa83@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231016083559.139341-1-savicaleksa83@gmail.com> References: <20231016083559.139341-1-savicaleksa83@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 16 Oct 2023 01:38:40 -0700 (PDT) Return -ENODATA if a temp sensor of a legacy device does not contain a reading. Originally-from: Leonard Anderweit Signed-off-by: Aleksa Savic --- drivers/hwmon/aquacomputer_d5next.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/hwmon/aquacomputer_d5next.c b/drivers/hwmon/aquacomputer_d5next.c index 023807859be7..46ff4fd4f87d 100644 --- a/drivers/hwmon/aquacomputer_d5next.c +++ b/drivers/hwmon/aquacomputer_d5next.c @@ -926,7 +926,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 */ -- 2.41.0