On 20/06/16 13:53, Mark Brown wrote: > 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@xxxxxxxxxx> Applied to the fixes-togreg branch of iio.git and marked for stable. Thanks Mark, Jonathan > --- > drivers/iio/adc/ad7266.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/iio/adc/ad7266.c b/drivers/iio/adc/ad7266.c > index 21e19b60e2b9..835d45db258f 100644 > --- a/drivers/iio/adc/ad7266.c > +++ b/drivers/iio/adc/ad7266.c > @@ -397,7 +397,7 @@ static int ad7266_probe(struct spi_device *spi) > 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; > -- To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html