From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2829CC433EF for ; Sat, 16 Jul 2022 16:17:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=wX+uQiVfrg+ceCMmPKfFer4xVNr/FSYFLxyTjcIt97E=; b=nJUWTDH+Qa6aIg JpUcVRwQTTM/HH/2PVXze9FIwpsvWtTblHlUMY3HCGJIOLzbS42656+teuo6TPQkXaFTpb3XOLzuE qIcUxu1GCFPjI5U9FHRngk+bQINumPkyCaHxmKHaG7ufsvhZVuUM/BfenJh7n6+838RV8yDKLm5hb sNozmqSu4EgGA3gQ8Ey9ufxnkbIpeOAf8IPXoRMf6kmB5zCWoCm3rlvnrnOiUus3Hro8LpU9k9hxH B3BsaoheXPiwuHVapvLBjnirGYg8p3Lhunxs7BkFn4OnHZv8gJs4mOAtxGlwwZYu7wafjQ/syeICU ZOtP/UqzGDbubTyxs6xA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oCkTG-00H23r-DN; Sat, 16 Jul 2022 16:16:46 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oCkTD-00H21o-IO for linux-arm-kernel@lists.infradead.org; Sat, 16 Jul 2022 16:16:44 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 14496B80ADB; Sat, 16 Jul 2022 16:16:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F3B46C34114; Sat, 16 Jul 2022 16:16:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657988200; bh=EM8506xTiG1cl6Cg93zrB1iDx/WXUg8rdBcmVObgDgE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=dwI2A2u1b1PJGw//RwVPc5rCNhFXROpv846FGGt8ysJxeHv3M85mBBIoSQ3cveWqh Ykr6qOt0bQZ7oEPWF6uFzZhqLBMl5EKityIxFNvZcb8YYyWRfbDC1ATqcLsbdBHARz EruAt/UujEcBRhvX1AvIweF4IQ4YwXGgDqYB9I+MvtAJuD+linlR237BXxiFfJlvIC LO3bUxP0+Bt8+C6jyGwYQPEAS7OlYMb52k6/pdiFJBDnfD47504ctAs4TRK/CU85tM 3dxkFHgBY0c7QYGGKjn1utNgy1j6rBkQRcwqeUAj7oAwGXLwmO5Bt50oNKWl1Ytbt9 kRxN3Yz8Bzbzw== Date: Sat, 16 Jul 2022 17:26:32 +0100 From: Jonathan Cameron To: Claudiu Beznea Subject: Re: [PATCH v2 02/19] iio: adc: at91-sama5d2_adc: check return status for pressure and touch Message-ID: <20220716172632.01fee63c@jic23-huawei> In-Reply-To: <20220716172531.684b2878@jic23-huawei> References: <20220628151631.3116454-1-claudiu.beznea@microchip.com> <20220628151631.3116454-3-claudiu.beznea@microchip.com> <20220716172531.684b2878@jic23-huawei> X-Mailer: Claws Mail 4.1.0 (GTK 3.24.34; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220716_091643_780229_12FF0310 X-CRM114-Status: GOOD ( 21.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, alexandre.belloni@bootlin.com, lars@metafoo.de, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, robh+dt@kernel.org, eugen.hristev@microchip.com, krzk+dt@kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sat, 16 Jul 2022 17:25:31 +0100 Jonathan Cameron wrote: > On Tue, 28 Jun 2022 18:16:14 +0300 > Claudiu Beznea wrote: > > > Check return status of at91_adc_read_position() and > > at91_adc_read_pressure() in at91_adc_read_info_raw(). > > > > Fixes: 6794e23fa3fe ("iio: adc: at91-sama5d2_adc: add support for oversampling resolution") > > Signed-off-by: Claudiu Beznea > > --- > > drivers/iio/adc/at91-sama5d2_adc.c | 8 ++++++-- > > 1 file changed, 6 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/iio/adc/at91-sama5d2_adc.c b/drivers/iio/adc/at91-sama5d2_adc.c > > index 32b6f157b803..c3301c749164 100644 > > --- a/drivers/iio/adc/at91-sama5d2_adc.c > > +++ b/drivers/iio/adc/at91-sama5d2_adc.c > > @@ -1544,8 +1544,10 @@ static int at91_adc_read_info_raw(struct iio_dev *indio_dev, > > *val = tmp_val; > > mutex_unlock(&st->lock); > > iio_device_release_direct_mode(indio_dev); > Prefer to keep error path out of line. > > if (ret < 0) > return ret; > > return at91_adc_adjust_val_osr(); > > Also ends up as a slightly less invasive change. Ah. I should have read on through the series. Ignore this. > > > + if (ret > 0) > > + ret = at91_adc_adjust_val_osr(st, val); > > > > - return at91_adc_adjust_val_osr(st, val); > > + return ret; > > } > > if (chan->type == IIO_PRESSURE) { > > ret = iio_device_claim_direct_mode(indio_dev); > > @@ -1558,8 +1560,10 @@ static int at91_adc_read_info_raw(struct iio_dev *indio_dev, > > *val = tmp_val; > > mutex_unlock(&st->lock); > > iio_device_release_direct_mode(indio_dev); > > + if (ret > 0) > > + ret = at91_adc_adjust_val_osr(st, val); > > > > - return at91_adc_adjust_val_osr(st, val); > As above. > > > + return ret; > > } > > > > /* in this case we have a voltage channel */ > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel