From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966536AbcKLQgo (ORCPT ); Sat, 12 Nov 2016 11:36:44 -0500 Received: from saturn.retrosnub.co.uk ([178.18.118.26]:35903 "EHLO saturn.retrosnub.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966413AbcKLQgm (ORCPT ); Sat, 12 Nov 2016 11:36:42 -0500 Subject: Re: [PATCH v3 16/28] staging: iio: tsl2583: updated code comment to match what the code does To: Brian Masney , linux-iio@vger.kernel.org References: <1478769964-7065-1-git-send-email-masneyb@onstation.org> <1478769964-7065-17-git-send-email-masneyb@onstation.org> Cc: devel@driverdev.osuosl.org, gregkh@linuxfoundation.org, lars@metafoo.de, pmeerw@pmeerw.net, knaack.h@gmx.de, linux-kernel@vger.kernel.org, Jon.Brenner@ams.com From: Jonathan Cameron Message-ID: <67166adf-5a89-3283-8a16-9a0a9a57e770@kernel.org> Date: Sat, 12 Nov 2016 16:36:37 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <1478769964-7065-17-git-send-email-masneyb@onstation.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/11/16 09:25, Brian Masney wrote: > If channel 0 does not have any data, then the code sets the lux to zero. > The corresponding comment says that the last value is returned. This > updates the comment to correctly reflect what the code does. > > Signed-off-by: Brian Masney Better perhaps to just return an error, -EAGAIN perhaps? I'm not sure why it would not give a value. > --- > drivers/staging/iio/light/tsl2583.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/iio/light/tsl2583.c b/drivers/staging/iio/light/tsl2583.c > index 52a39a6..390ff8b 100644 > --- a/drivers/staging/iio/light/tsl2583.c > +++ b/drivers/staging/iio/light/tsl2583.c > @@ -221,7 +221,7 @@ static int tsl2583_get_lux(struct iio_dev *indio_dev) > goto return_max; > > if (!ch0) { > - /* have no data, so return LAST VALUE */ > + /* have no data, so return 0 */ > ret = 0; > chip->als_cur_info.lux = 0; > goto done; >