Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1462082 > unrolled thread

[PATCH 3.16 232/305] iio:ad7266: Fix broken regulator error handling

Started byBen Hutchings <ben@decadent.org.uk>
First post2016-08-14 14:10 +0200
Last post2016-08-14 14:10 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 3.16 232/305] iio:ad7266: Fix broken regulator error handling Ben Hutchings <ben@decadent.org.uk> - 2016-08-14 14:10 +0200

#1462082 — [PATCH 3.16 232/305] iio:ad7266: Fix broken regulator error handling

FromBen Hutchings <ben@decadent.org.uk>
Date2016-08-14 14:10 +0200
Subject[PATCH 3.16 232/305] iio:ad7266: Fix broken regulator error handling
Message-ID<s62oO-7TC-21@gated-at.bofh.it>
3.16.37-rc1 review patch.  If anyone has any objections, please let me know.

------------------

From: Mark Brown <broonie@kernel.org>

commit 6b7f4e25f3309f106a5c7ff42c8231494cf285d3 upstream.

All regulator_get() variants return either a pointer to a regulator or an
ERR_PTR() so testing for NULL makes no sense and may lead to bugs if we
use NULL as a valid regulator. Fix this by using IS_ERR() as expected.

Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/iio/adc/ad7266.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/iio/adc/ad7266.c
+++ b/drivers/iio/adc/ad7266.c
@@ -397,7 +397,7 @@ static int ad7266_probe(struct spi_devic
 	st = iio_priv(indio_dev);
 
 	st->reg = devm_regulator_get(&spi->dev, "vref");
-	if (!IS_ERR_OR_NULL(st->reg)) {
+	if (!IS_ERR(st->reg)) {
 		ret = regulator_enable(st->reg);
 		if (ret)
 			return ret;

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web