iio:adc:ad7766: Fix unnecessary check in ad7766_probe()
authorTang Bin <tangbin@cmss.chinamobile.com>
Tue, 11 May 2021 13:47:39 +0000 (21:47 +0800)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 17 May 2021 13:10:24 +0000 (14:10 +0100)
In the function ad7766_probe(), the return value of
devm_iio_device_register() can be zero or ret, Thus it
is unnecessary to repeated check here.

Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Co-developed-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Link: https://lore.kernel.org/r/20210511134739.948-1-tangbin@cmss.chinamobile.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ad7766.c

index 236a455..9b35c09 100644 (file)
@@ -290,10 +290,7 @@ static int ad7766_probe(struct spi_device *spi)
        if (ret)
                return ret;
 
-       ret = devm_iio_device_register(&spi->dev, indio_dev);
-       if (ret)
-               return ret;
-       return 0;
+       return devm_iio_device_register(&spi->dev, indio_dev);
 }
 
 static const struct spi_device_id ad7766_id[] = {