aboutsummaryrefslogtreecommitdiff
path: root/drivers/iio/adc/ad7766.c
diff options
context:
space:
mode:
authorTang Bin2021-05-11 21:47:39 +0800
committerJonathan Cameron2021-05-17 14:10:24 +0100
commitbd1455615f402c63458492875dce4d848cbb2210 (patch)
tree08926866b5ddd2be97ebcdbb2e5b8cafce159a1f /drivers/iio/adc/ad7766.c
parent43fa739450492a0b870802d471de923184870a4c (diff)
iio:adc:ad7766: Fix unnecessary check in ad7766_probe()
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>
Diffstat (limited to 'drivers/iio/adc/ad7766.c')
-rw-r--r--drivers/iio/adc/ad7766.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/iio/adc/ad7766.c b/drivers/iio/adc/ad7766.c
index 236a455aaa18..9b35c09b9313 100644
--- a/drivers/iio/adc/ad7766.c
+++ b/drivers/iio/adc/ad7766.c
@@ -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[] = {