Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp2999214ybh; Mon, 5 Aug 2019 10:14:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqycZ1ab7Ma4bsb7eXZr/dqo4DKbEWBMb0imNztiN9ApgxXNOcVbiuP3qa5PUYu2KCuOoYY1 X-Received: by 2002:a17:90a:71ca:: with SMTP id m10mr19539307pjs.27.1565025274903; Mon, 05 Aug 2019 10:14:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565025274; cv=none; d=google.com; s=arc-20160816; b=SJocd0s/+MmoWkkFQVVVgt9oNoa3NhFhuGPEO6MIkdZUNSUbSqCCe+1B6C3NIm2nFj quht33yw80oztqFoZYVLsx4dpkXwmYeAV8Jp7j+M+vzLDSe7fwUYlOTeWt0mAM5ZNi2H +VOUQG/yuLDExyCyd5397bZpD9pFlncx3t13uV4JXW9zRInyQMXFMecSpeXhLjVOXPMR 5rj92KA0dETEsQcOC1SJ4qfTMbubjd9ehrDVG+a2xZ5IH6jdabCya+pfWZdLdlgiQ2yG 7fXF9vxUfVFDXHMq8TvMikxezh4QJzG12r+dBf/f2imwPuQ+xl+/SEjOGQ8bq+QbB2Aq 0Bjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=r+1g9NdLV9OVbgRXKP7dp6MYQ0P/bYb3jl7i313vH8I=; b=hgDMeEWTvxKB8R/kJ+4f8w+6Y0KBD8FDLWQTCSj3SZJ7Q9OcAxMrxZqF/JY09wZyV1 mNDUyoaMwkLISFmERbzQ1NC82erqubKDpjueD2DfJg4FRgqdLENDyQVRMJ0eNU52qhap IDzvUJyBlLcHjGLIspVGDYQzERciF9WTGm7zZhvHh/hbxDnPGJGfQeCXuxO1Aa/m4Qie kbgSzlMpEZyzB4Agc+yxgUH9ScqXn0ndRFZ2BlFEHn4sKUcOpETTKuUC1hN3NaQaDIue 2PqtNYZvyZtzS/tDQkoe131s6wN9nGkZXtpK397JKEYiNKTOkqzl6An53q6H4XE2I0Kr bV5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wpXa3IL7; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x66si36129405pfd.156.2019.08.05.10.14.19; Mon, 05 Aug 2019 10:14:34 -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; dkim=pass header.i=@kernel.org header.s=default header.b=wpXa3IL7; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729780AbfHERNA (ORCPT + 99 others); Mon, 5 Aug 2019 13:13:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:48466 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729539AbfHERM7 (ORCPT ); Mon, 5 Aug 2019 13:12:59 -0400 Received: from archlinux (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B5E28208E3; Mon, 5 Aug 2019 17:12:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565025178; bh=6yjVKWPUFOxwA8zJj/J+Ue0Uov6l8f2Foajl870T97Y=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=wpXa3IL7o9MNvGeCAQsN2jRt1b1C9cQfXWYl/r5oCtyG6+b30Mtc+YbSS5XvtD4bo RHA0eB3MYptGCsJMHBVd5LV064hcHwpMUUv6o77pGym89iBKIl97qSCnLTdNfmdEe7 GZnKP/jmk2B68oKjMz5drXPrL1csN/R/XKLZYTUU= Date: Mon, 5 Aug 2019 18:12:44 +0100 From: Jonathan Cameron To: Jacopo Mondi Cc: 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: <20190805181244.663585ac@archlinux> In-Reply-To: <20190805155515.22621-1-jacopo+renesas@jmondi.org> References: <20190805155515.22621-1-jacopo+renesas@jmondi.org> X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > --- > 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 >