Skip to contentSkip to conversation

iio:adc: ad7766: testing the wrong variable in probe

PATCH In review Dan Carpenter 3 participants 3 messages Nov 10, 2016 – Nov 12, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iio:adc: ad7766: testing the wrong variable in probe

We should be testing "ret" here.

Fixes aa16c6bd0e09 ("iio:adc: Add support for AD7766/AD7767")
drivers/iio/adc/ad7766.c +2 -2
index d906686..75cca42 100644
@@ -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);
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Dan Carpenter

We should be testing "ret" here.

Fixes aa16c6bd0e09 ("iio:adc: Add support for AD7766/AD7767")

Thanks.

Quoted 17 lines
drivers/iio/adc/ad7766.c +2 -2
index d906686..75cca42 100644
@@ -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);
maintainer
#2 lore raw
Quoted 8 lines · Lars-Peter Clausen
Quoted 4 lines · Dan Carpenter

We should be testing "ret" here.

Fixes aa16c6bd0e09 ("iio:adc: Add support for AD7766/AD7767")

Applied to the togreg branch of iio.git. Will push out as testing later for the autobuilders to play with it.

Thanks,

Jonathan

Quoted 25 lines

Thanks.

Quoted 7 lines
drivers/iio/adc/ad7766.c +0 -0
index d906686..75cca42 100644

drivers/iio/adc/ad7766.c static int ad7766_probe(struct spi_device *spi) · line 246

Quoted 10 lines
drivers/iio/adc/ad7766.c +2 -2
@@ -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);

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html