From: Jonathan Cameron <jic23@kernel.org>
To: Zizhuang Deng <sunsetdzz@gmail.com>
Cc: Jonathan.Cameron@huawei.com, linux-kernel@vger.kernel.org,
linux-iio@vger.kernel.org,
Paul Cercueil <paul.cercueil@analog.com>,
Paul Cercueil <paul@crapouillou.net>
Subject: Re: [PATCH] iio: dac: ad5592r: Fix the missing return value.
Date: Sun, 20 Mar 2022 15:20:47 +0000 [thread overview]
Message-ID: <20220320152047.2a04a62e@jic23-huawei> (raw)
In-Reply-To: <20220310125450.4164164-1-sunsetdzz@gmail.com>
On Thu, 10 Mar 2022 20:54:50 +0800
Zizhuang Deng <sunsetdzz@gmail.com> wrote:
> The third call to `fwnode_property_read_u32` did not record
> the return value, resulting in `channel_offstate` possibly
> being assigned the wrong value.
>
> Signed-off-by: Zizhuang Deng <sunsetdzz@gmail.com>
Hi,
Definitely rather odd looking and I think your conclusion is correct.
+CC Paul for confirmation that this isn't doing something clever..
> ---
> drivers/iio/dac/ad5592r-base.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/dac/ad5592r-base.c b/drivers/iio/dac/ad5592r-base.c
> index a424b7220b61..4434c1b2a322 100644
> --- a/drivers/iio/dac/ad5592r-base.c
> +++ b/drivers/iio/dac/ad5592r-base.c
> @@ -522,7 +522,7 @@ static int ad5592r_alloc_channels(struct iio_dev *iio_dev)
> if (!ret)
> st->channel_modes[reg] = tmp;
>
> - fwnode_property_read_u32(child, "adi,off-state", &tmp);
> + ret = fwnode_property_read_u32(child, "adi,off-state", &tmp);
> if (!ret)
> st->channel_offstate[reg] = tmp;
> }
next prev parent reply other threads:[~2022-03-20 15:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-10 12:54 [PATCH] iio: dac: ad5592r: Fix the missing return value Zizhuang Deng
2022-03-20 15:20 ` Jonathan Cameron [this message]
2022-03-21 9:28 ` Paul Cercueil
2022-03-27 16:19 ` Jonathan Cameron
2022-03-27 19:52 ` Andy Shevchenko
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=20220320152047.2a04a62e@jic23-huawei \
--to=jic23@kernel.org \
--cc=Jonathan.Cameron@huawei.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paul.cercueil@analog.com \
--cc=paul@crapouillou.net \
--cc=sunsetdzz@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