Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp3742271ybh; Tue, 6 Aug 2019 00:32:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqwRCshCdN0mAhuqFN91A9t7XIC7uDH9nwZ8R6Dr86O1P+zuvYFW9i8f1OeY/Ri9Et2XRfz+ X-Received: by 2002:a63:dd16:: with SMTP id t22mr1827182pgg.140.1565076738519; Tue, 06 Aug 2019 00:32:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565076738; cv=none; d=google.com; s=arc-20160816; b=oJZMVP+JzGjkvsOEaBPBjImk21o7UMcy8vSBkbFrvSlb4S3WVcsuartxN9F383xuuh hX46r/YXGORu2UQ5P+asyKradivyV7FV+MuIRySpLFln54JcrdT2Tq06v5UgRwJsH3sj cH15QrxWRxROB9E9WqHWBN88IfdO8W2AX9C+nfc+71qlgmJ0xHEUO8lm3rzBfC2gx8Bj HQEfEanYeLWGhTVsvXNZPQ2BvgugyPLT2zq+zk6elbkP8A9NyVhQHCDzB/ABedhGJT6B NMIYK0GjBCBQQLhI5auzB3IXbd6AdXEVM5SKa5qKFSLVQUV0trbwGmcURYpdTUhxKfvo wNTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=qEwCaER/36bC3f5hNnWpkowGX7PEvC06qqAFoA6Y2+E=; b=iX6CJ6LFLjKnFQJ1xRyRxzXydln/owLhObFiOBbMELcsz0TnmfoWoupCHbuHKzgYZc 4qnRso0ufKejSiuFrHnwYu7LoESWIMrMhflTWL2ZQlEh+kdtPfmb/fU8TQ6XN8CD4iY9 HE0w+TNpIUlTjUag+mNnQpdHrKMCYIB0rOyCnlehXlNceABjY5wip/S2iWVExPeqDLrX LaoNY5D14R98EDcoYQZz4BOEFq1CtWXWe1cnU32MabpE0mk9nSEXzA773yGihxrqujwf m5cQREkv/dG8eq3qVBUPb9bh6/k7M3u04lnnNBChTt84Ug7qcwZpKVqXBuJsfEYxEEnl dSOg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u20si44628994pgg.565.2019.08.06.00.32.02; Tue, 06 Aug 2019 00:32:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732229AbfHFH34 (ORCPT + 99 others); Tue, 6 Aug 2019 03:29:56 -0400 Received: from relay12.mail.gandi.net ([217.70.178.232]:42819 "EHLO relay12.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731807AbfHFH34 (ORCPT ); Tue, 6 Aug 2019 03:29:56 -0400 Received: from uno.localdomain (mob-109-112-31-244.net.vodafone.it [109.112.31.244]) (Authenticated sender: jacopo@jmondi.org) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 79D0420000F; Tue, 6 Aug 2019 07:29:51 +0000 (UTC) Date: Tue, 6 Aug 2019 09:31:14 +0200 From: Jacopo Mondi To: Jonathan Cameron Cc: Jacopo Mondi , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Kuninori Morimoto , Stefan Agner , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] iio: adc: max9611: Fix temperature reading in probe Message-ID: <20190806073114.4mujzdvbrgxivizs@uno.localdomain> References: <20190805155515.22621-1-jacopo+renesas@jmondi.org> <20190805181244.663585ac@archlinux> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="hmkibl6tqohgtmac" Content-Disposition: inline In-Reply-To: <20190805181244.663585ac@archlinux> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --hmkibl6tqohgtmac Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Hi Jonathan, On Mon, Aug 05, 2019 at 06:12:44PM +0100, Jonathan Cameron wrote: > On Mon, 5 Aug 2019 17:55:15 +0200 > Jacopo Mondi wrote: > > > The max9611 driver reads the die temperature at probe time to validate > > the communication channel. Use the actual read value to perform the test > > instead of the read function return value, which was mistakenly used so > > far. > > > > The temperature reading test was only successful because the 0 return > > value is in the range of supported temperatures. > > > > Fixes: 69780a3bbc0b ("iio: adc: Add Maxim max9611 ADC driver") > > Signed-off-by: Jacopo Mondi > > Applied to the fixes-togreg branch of iio.git and marked for > stable. That'll be a bit fiddly given other changes around this > so we may need to do backports. > Indeed, I should have mentioned this patch depends on Joe's ae8cc91a7d85 ("iio: adc: max9611: Fix misuse of GENMASK macro") which is now in linux-next, otherwise it might atually trigger errors due to the wrong mask value. I wonder if there's a way to keep track of these dependencies for the sake of backporting, or it's an operation that has to be carried out manually... Thanks j > > > --- > > drivers/iio/adc/max9611.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/iio/adc/max9611.c b/drivers/iio/adc/max9611.c > > index 917223d5ff5b..e9f6b1da1b94 100644 > > --- a/drivers/iio/adc/max9611.c > > +++ b/drivers/iio/adc/max9611.c > > @@ -480,7 +480,7 @@ static int max9611_init(struct max9611_dev *max9611) > > if (ret) > > return ret; > > > > - regval = ret & MAX9611_TEMP_MASK; > > + regval &= MAX9611_TEMP_MASK; > > > > if ((regval > MAX9611_TEMP_MAX_POS && > > regval < MAX9611_TEMP_MIN_NEG) || > > -- > > 2.22.0 > > > --hmkibl6tqohgtmac Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEtcQ9SICaIIqPWDjAcjQGjxahVjwFAl1JLMIACgkQcjQGjxah Vjx4OBAAxQU3tgkW1phGiUlCylmAblCdAtYezFCdcbL28QA5ui5zPocDUerLjRar 06uAx/kjK5oxH9rDMWh5OgwznfUkenGpNeo3n6/n7CVq6yUW4oTzb802/5EgqOfP 4P7iKVRbEwOj3DJgcS/l+GCqkZfDj+IncK5C4up2c0NYvTr4kIDOHFCr84qI4Doe 6O7DDmNZsA1GHTc/KbMBuo0AekVF7SdXgzSHm+EN41SOPK93YtvS7d9z7ethOvYr cHrdtWveTOK+HNTO0fWILq0wdKC+n0FXSnGBVdWDPRBJCzYyUIvP9m4NTDETe9fE PQH84hC052OmoUxwQmnLh8FB15d4VfOfP/QuykvaVuao3JoQyI4EeVzEgiGV1Eg6 nhkr/QsEMmxgAzDGVZ39eSXJWZos4lueWnQ5ohzTs5SjeYQnFsPMEnsNoGfX15wL z3Z2hZh9Ra8fs3cDeijbwbyljffVEA+ZnFXPItjlZaNeMTKXM66qSy0vKENteRJi JJPNAO+3/MDDWFweAUFXimd8htUSAHWEuRRG2EE5sweBam4V/AnkC3AdZsVXBMeg QtuS4/VfkZXS1UL8FOGyWU9xQ+daMc2vMDWeA/+EwEes8s1uMzP6aAQ1h6y/W46s g6+sxY53Yp+RzsNKoi8OCiQpF7lkESc9XxUKuKV0jhrhT6oQLZE= =oFtH -----END PGP SIGNATURE----- --hmkibl6tqohgtmac--