diff options
author | Cristina Opriceana <cristina.opriceana@gmail.com> | 2015-03-12 17:10:31 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-03-16 15:11:40 (GMT) |
commit | da29461ccdf811b27a1cf53483ec2457fb4a6ae7 (patch) | |
tree | 70175a782a89f1c143982086e7d767a55a22b059 | |
parent | 5db4851d47ea80ad78d85f201e13df9ea48ab67b (diff) | |
download | linux-da29461ccdf811b27a1cf53483ec2457fb4a6ae7.tar.xz |
Staging: iio: Simplify return logic
This patch removes the conditional return of the ade77*_probe functions
based on the return values of iio_device_register as the latter
returns 0 or ret, the same as the checked values.
Warning found by coccinelle.
Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Reviewed-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/iio/meter/ade7753.c | 6 | ||||
-rw-r--r-- | drivers/staging/iio/meter/ade7754.c | 6 | ||||
-rw-r--r-- | drivers/staging/iio/meter/ade7759.c | 6 |
3 files changed, 3 insertions, 15 deletions
diff --git a/drivers/staging/iio/meter/ade7753.c b/drivers/staging/iio/meter/ade7753.c index f828f5f..ffc7f0d 100644 --- a/drivers/staging/iio/meter/ade7753.c +++ b/drivers/staging/iio/meter/ade7753.c @@ -517,11 +517,7 @@ static int ade7753_probe(struct spi_device *spi) if (ret) return ret; - ret = iio_device_register(indio_dev); - if (ret) - return ret; - - return 0; + return iio_device_register(indio_dev); } /* fixme, confirm ordering in this function */ diff --git a/drivers/staging/iio/meter/ade7754.c b/drivers/staging/iio/meter/ade7754.c index e7171b5..8dc5089 100644 --- a/drivers/staging/iio/meter/ade7754.c +++ b/drivers/staging/iio/meter/ade7754.c @@ -540,11 +540,7 @@ static int ade7754_probe(struct spi_device *spi) ret = ade7754_initial_setup(indio_dev); if (ret) return ret; - ret = iio_device_register(indio_dev); - if (ret) - return ret; - - return 0; + return iio_device_register(indio_dev); } /* fixme, confirm ordering in this function */ diff --git a/drivers/staging/iio/meter/ade7759.c b/drivers/staging/iio/meter/ade7759.c index 2d5f038..7eef8b9 100644 --- a/drivers/staging/iio/meter/ade7759.c +++ b/drivers/staging/iio/meter/ade7759.c @@ -462,11 +462,7 @@ static int ade7759_probe(struct spi_device *spi) if (ret) return ret; - ret = iio_device_register(indio_dev); - if (ret) - return ret; - - return 0; + return iio_device_register(indio_dev); } /* fixme, confirm ordering in this function */ |