linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] iio:adc: ad7766: testing the wrong variable in probe
@ 2016-11-10 19:30 Dan Carpenter
  2016-11-11 13:50 ` Lars-Peter Clausen
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2016-11-10 19:30 UTC (permalink / raw)
  To: Lars-Peter Clausen
  Cc: Michael Hennerich, Jonathan Cameron, Hartmut Knaack,
	Peter Meerwald-Stadler, linux-iio, kernel-janitors

We should be testing "ret" here.

Fixes: aa16c6bd0e09 ("iio:adc: Add support for AD7766/AD7767")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/iio/adc/ad7766.c b/drivers/iio/adc/ad7766.c
index d906686..75cca42 100644
--- a/drivers/iio/adc/ad7766.c
+++ b/drivers/iio/adc/ad7766.c
@@ -239,8 +239,8 @@ static int ad7766_probe(struct spi_device *spi)
 
 	ret = devm_regulator_bulk_get(&spi->dev, ARRAY_SIZE(ad7766->reg),
 		ad7766->reg);
-	if (IS_ERR(ad7766->reg))
-		return PTR_ERR(ad7766->reg);
+	if (ret)
+		return ret;
 
 	ad7766->pd_gpio = devm_gpiod_get_optional(&spi->dev, "powerdown",
 		GPIOD_OUT_HIGH);

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-11-12 14:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-10 19:30 [patch] iio:adc: ad7766: testing the wrong variable in probe Dan Carpenter
2016-11-11 13:50 ` Lars-Peter Clausen
2016-11-12 14:36   ` Jonathan Cameron

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).