[PATCH] fix

From: Alisa-Dariana Roman
Date: Wed May 22 2024 - 05:50:44 EST


---

Would this fix be alright, since writing something like if(!ret) may be
confusing?

And regarding the comment, my bad, there is nothing wrong there.

drivers/iio/adc/ad7192.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/iio/adc/ad7192.c b/drivers/iio/adc/ad7192.c
index 101afce49378..0789121236d6 100644
--- a/drivers/iio/adc/ad7192.c
+++ b/drivers/iio/adc/ad7192.c
@@ -1101,14 +1101,12 @@ static int ad7194_parse_channels(struct iio_dev *indio_dev)
ret = fwnode_property_read_u32_array(child, "diff-channels",
ain, ARRAY_SIZE(ain));
if (ret == 0) {
- ret = ad7194_validate_ain_channel(dev, ain[0]);
- if (ret)
+ if (!ad7194_validate_ain_channel(dev, ain[0]))
return dev_err_probe(dev, -EINVAL,
"Invalid AIN channel: %u\n",
ain[0]);

- ret = ad7194_validate_ain_channel(dev, ain[1]);
- if (ret)
+ if (!ad7194_validate_ain_channel(dev, ain[1]))
return dev_err_probe(dev, -EINVAL,
"Invalid AIN channel: %u\n",
ain[1]);
@@ -1125,8 +1123,7 @@ static int ad7194_parse_channels(struct iio_dev *indio_dev)
return dev_err_probe(dev, ret,
"Missing channel property\n");

- ret = ad7194_validate_ain_channel(dev, ain[0]);
- if (ret)
+ if (!ad7194_validate_ain_channel(dev, ain[0]))
return dev_err_probe(dev, -EINVAL,
"Invalid AIN channel: %u\n",
ain[0]);
--
2.34.1