From: Subhajit Ghosh <subhajit.ghosh@tweaklogic.com>
To: Mudit Sharma <muditsharma.info@gmail.com>,
jic23@kernel.org, lars@metafoo.de, dan.carpenter@linaro.org
Cc: linux-iio@vger.kernel.org
Subject: Re: [PATCH] iio: light: apds9306: Fix error handing
Date: Wed, 26 Jun 2024 21:40:29 +0930 [thread overview]
Message-ID: <bea64407-fcf4-4a87-bd77-6bd3f3e2f70b@tweaklogic.com> (raw)
In-Reply-To: <20240625210203.522179-1-muditsharma.info@gmail.com>
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>
Regards,
Subhajit Ghosh
next prev parent reply other threads:[~2024-06-26 12:10 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 [this message]
2024-06-29 17:52 ` Jonathan Cameron
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=bea64407-fcf4-4a87-bd77-6bd3f3e2f70b@tweaklogic.com \
--to=subhajit.ghosh@tweaklogic.com \
--cc=dan.carpenter@linaro.org \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=muditsharma.info@gmail.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;
as well as URLs for NNTP newsgroup(s).