Re: [patch] iio:adc: ad7766: testing the wrong variable in probe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/10/2016 08:30 PM, Dan Carpenter wrote:
> We should be testing "ret" here.
> 
> Fixes: aa16c6bd0e09 ("iio:adc: Add support for AD7766/AD7767")
> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>

Acked-by: Lars-Peter Clausen <lars@xxxxxxxxxx>

Thanks.

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

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux