Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp2801490rda; Wed, 25 Oct 2023 12:42:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGEf30GQlSbdZdJv5QYcS8PdoHbMVCwrYjb8U3VJMEugGONO+LKC/KINqtQpLRlxwBQZBCM X-Received: by 2002:a25:abc9:0:b0:da0:47b0:5241 with SMTP id v67-20020a25abc9000000b00da047b05241mr5865329ybi.34.1698262925821; Wed, 25 Oct 2023 12:42:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698262925; cv=none; d=google.com; s=arc-20160816; b=EcjRl/dln9BKVUPNRD2rQZlDkuhyrcnnA4mihdf2lUxYeBixRLk7kkk+3123FtxAes qTrtxO/9D+ARHFuTjk3YicRAJgDr3Rs4QPpojfIrJ+FXU+a0bZx3VWDIFV7DnmganX2C XL/StkSGE1HaVAKWIaN3ujAmjLHkQoOVB2Esx7GnRRPXox1GAy+N1+xpF0oi0YlLnCyF EZlOQyJ9b3FNzeGshD9vTF0QY/8hKhOD+PlBTsEcDCmIOQdnHkUikTjNAHKD+PJjQsdr Bf8dDAGlwW73EbIV7Q2R2I+DUOhsv7xKSsCEJh2zg4cHnzmgS+gnm23c9730eICdnrRb i8yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:sender:dkim-signature; bh=IdzTaQLvIjWdCW23uUwjApK25y8OzySo8bAMr5Qvrrc=; fh=66glmooP+Puxbgn6LHw28apmPBVDTuD3/DFrTpwiv28=; b=wBvkTEU6xIvh+KbTehTnVrSKhZBDILRBGkeFSdxCHbwaQaMAtIX8dm1/Hmp9jdqm81 IEhLE/oYvR5hV1wyxst8fzMWK3HRt43ys3iCZBJdc5lluX6pMKlJGbmWCCFX8a6rmhc6 UM6V9ae+LSRXRL/N89LdHqPG0LIXWP/GRkGAxqAw0krOWmRT9LMkDx0w3q3khSFN+CjO +/pLvvxU9DrhPrsSYdfSGEEcb4WSv7POwX5sPsO6sz4FElhwVcF3yVPAbaOuIys/n/m+ 2s/d8ldGUMSj66WokhkyTQYELOxE72JShGHD6cBSkRz6G2klNGNG7bI4cLicmd7v0rUP yDeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="G/jmQSvS"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id r196-20020a2576cd000000b00d9aca44102csi13614641ybc.541.2023.10.25.12.41.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 12:42:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="G/jmQSvS"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 38815804C626; Wed, 25 Oct 2023 12:41:11 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232688AbjJYTlF (ORCPT + 99 others); Wed, 25 Oct 2023 15:41:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229498AbjJYTlE (ORCPT ); Wed, 25 Oct 2023 15:41:04 -0400 Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4BC5B189; Wed, 25 Oct 2023 12:41:02 -0700 (PDT) Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1ca3a54d2c4so388485ad.3; Wed, 25 Oct 2023 12:41:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698262862; x=1698867662; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=IdzTaQLvIjWdCW23uUwjApK25y8OzySo8bAMr5Qvrrc=; b=G/jmQSvS+vH8+KbuGGYKLBZJFM2R3+8UcQj38qZyeJyGpoJKGQDXP0JaqPe8LjIlx5 F82OIpd8Q8+OvAPTSZAkCe1P+V31oZT1rr0jEGzSHqqYoNevW9Wx8zh9yPQcb5CvLZbA SEAmnIjI579p206cMAPpXP9wfNm8lVk4kIgZd8sl1tnAtjMkY5p5G4gPyNzVG8AL/6kg WeFnTfzdu96PrAb9Ay8PIZigZjGRozcg4/KruPiNlyONeY8sgtHg4s/gGe5mEFKoc/+/ ARxsFgl1odZM0Ha1pSalrFvLDGvaqvVjVSj+WWURYYPaF0rl+bfu98awvDKVix/kU5To kgWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698262862; x=1698867662; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IdzTaQLvIjWdCW23uUwjApK25y8OzySo8bAMr5Qvrrc=; b=bokGs0hm7WHIfySPIGarj8j+5Dx/+7kbSm7KE5SZqGdR1IQCGwx58oGztfSvlGGSX9 Th+daC6nIyjhCL34mL0OuO8v1rN96eQhCN8eAAtD7ZFEONtyKIRzajYK3Q9rKXjf0CDd ayxMkufCKP0qM2wWlS/JlrK+D6hl1fx3eAhefdpAMgzTMoarW3bqJHEWEJUH1KMog3et Oy5PmFd8zPo5uNtUdgGsbKmiG11w7R5kBzPeupR0DHz9chsbFys+ImmSuLtzTAXgSIIF ISUcKyav9zBqwwP85UHEzaqf2p6ckFcCUvyDp4apDHxb3Jo4CIU6NoB46cka9ZkKr5Aq LZ9A== X-Gm-Message-State: AOJu0YyPb1KCJJua0jfJ0xodzOpC97lPUBte0D+4g5nLpSQs28XPIUgJ +FvTU+9fZEL0699Zg/Xnymc= X-Received: by 2002:a17:903:644:b0:1c9:ca45:f86 with SMTP id kh4-20020a170903064400b001c9ca450f86mr13714334plb.18.1698262861743; Wed, 25 Oct 2023 12:41:01 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id t12-20020a170902a5cc00b001c74876f032sm9512635plq.162.2023.10.25.12.41.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 12:41:01 -0700 (PDT) Sender: Guenter Roeck Date: Wed, 25 Oct 2023 12:41:00 -0700 From: Guenter Roeck To: Aleksa Savic Cc: linux-hwmon@vger.kernel.org, leonard.anderweit@gmail.com, Jack Doan , Jean Delvare , Jonathan Corbet , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] hwmon: (aquacomputer_d5next) Check if temp sensors of legacy devices are connected Message-ID: References: <20231016083559.139341-1-savicaleksa83@gmail.com> <20231016083559.139341-2-savicaleksa83@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231016083559.139341-2-savicaleksa83@gmail.com> X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Wed, 25 Oct 2023 12:41:11 -0700 (PDT) On Mon, Oct 16, 2023 at 10:35:57AM +0200, Aleksa Savic wrote: > Return -ENODATA if a temp sensor of a legacy device > does not contain a reading. > Why is the sensor instantiated in the first place ? Returning -ENODATA for every reading is not desirable. If this can happen, the is_visible function should check for it and skip affected sensors. Guenter > 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 */