Staging: iio: Simplify return logic
authorCristina Opriceana <cristina.opriceana@gmail.com>
Thu, 12 Mar 2015 17:10:31 +0000 (19:10 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 16 Mar 2015 15:11:40 +0000 (16:11 +0100)
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>
drivers/staging/iio/meter/ade7753.c
drivers/staging/iio/meter/ade7754.c
drivers/staging/iio/meter/ade7759.c

index f828f5f3cb2c211c7fc97fd34f78999fdb231030..ffc7f0ddff14c7cc24eee0c109b6f6beefa1a928 100644 (file)
@@ -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 */
index e7171b532aa652e641b76dc60e4d6178974e3fc4..8dc5089772a39549e28e3df387c69b080646cb20 100644 (file)
@@ -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 */
index 2d5f038d3b30c96c490f25aa2c46273a0237d0a8..7eef8b9573fc85faaae975457966857d76dfdafc 100644 (file)
@@ -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 */