public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
From: Zizhuang Deng <sunsetdzz@gmail.com>
To: Jonathan.Cameron@huawei.com
Cc: linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org,
	Zizhuang Deng <sunsetdzz@gmail.com>
Subject: [PATCH] iio: dac: ad5592r: Fix the missing return value.
Date: Thu, 10 Mar 2022 20:54:50 +0800	[thread overview]
Message-ID: <20220310125450.4164164-1-sunsetdzz@gmail.com> (raw)

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>
---
 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;
 	}
-- 
2.25.1


             reply	other threads:[~2022-03-10 12:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-10 12:54 Zizhuang Deng [this message]
2022-03-20 15:20 ` [PATCH] iio: dac: ad5592r: Fix the missing return value Jonathan Cameron
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=20220310125450.4164164-1-sunsetdzz@gmail.com \
    --to=sunsetdzz@gmail.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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