From: Jonathan Cameron <jic23@kernel.org>
To: Subhajit Ghosh <subhajit.ghosh@tweaklogic.com>
Cc: Mudit Sharma <muditsharma.info@gmail.com>,
lars@metafoo.de, dan.carpenter@linaro.org,
linux-iio@vger.kernel.org
Subject: Re: [PATCH] iio: light: apds9306: Fix error handing
Date: Sat, 29 Jun 2024 18:52:27 +0100 [thread overview]
Message-ID: <20240629185227.59478a11@jic23-huawei> (raw)
In-Reply-To: <bea64407-fcf4-4a87-bd77-6bd3f3e2f70b@tweaklogic.com>
On Wed, 26 Jun 2024 21:40:29 +0930
Subhajit Ghosh <subhajit.ghosh@tweaklogic.com> wrote:
> On 26/6/24 06:32, Mudit Sharma wrote:
> > The return value of 'iio_gts_find_int_time_by_sel()' is assigned to
> > variable 'intg_old' but value of 'ret' is checked for error. Update to
> > use 'intg_old' for error checking.
> >
> > Fixes: 620d1e6c7a3f ("iio: light: Add support for APDS9306 Light Sensor")
> > Signed-off-by: Mudit Sharma <muditsharma.info@gmail.com>
> > ---
> > drivers/iio/light/apds9306.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/iio/light/apds9306.c b/drivers/iio/light/apds9306.c
> > index d6627b3e6000..66a063ea3db4 100644
> > --- a/drivers/iio/light/apds9306.c
> > +++ b/drivers/iio/light/apds9306.c
> > @@ -583,8 +583,8 @@ static int apds9306_intg_time_set(struct apds9306_data *data, int val2)
> > return ret;
> >
> > intg_old = iio_gts_find_int_time_by_sel(&data->gts, intg_time_idx);
> > - if (ret < 0)
> > - return ret;
> > + if (intg_old < 0)
> > + return intg_old;
> >
> > if (intg_old == val2)
> > return 0;
> Hi Mudit,
>
> Good find.
> Working well on my target dev board with your changes.
>
> Reviewed-by: Subhajit Ghosh <subhajit.ghosh@tweaklogic.com>
Applied to the fixes-togreg branch of iio.git and marked for stable.
Thanks,
Jonathan
>
>
> Regards,
> Subhajit Ghosh
prev parent reply other threads:[~2024-06-29 17:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-25 21:02 [PATCH] iio: light: apds9306: Fix error handing Mudit Sharma
2024-06-26 12:10 ` Subhajit Ghosh
2024-06-29 17:52 ` Jonathan Cameron [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240629185227.59478a11@jic23-huawei \
--to=jic23@kernel.org \
--cc=dan.carpenter@linaro.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=muditsharma.info@gmail.com \
--cc=subhajit.ghosh@tweaklogic.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox