iio: ad5504: Remove redundant variable
authorSachin Kamat <sachin.kamat@samsung.com>
Fri, 7 Mar 2014 07:38:00 +0000 (07:38 +0000)
committerJonathan Cameron <jic23@kernel.org>
Thu, 3 Jul 2014 20:58:26 +0000 (21:58 +0100)
By re-arranging the code, 'ret' can be removed from this
function.

Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/dac/ad5504.c

index c917dd24090a01ff32b4c695b3fed39373a8e2b4..581ec141de3df7ba92e6b2198c185fcef6acbc60 100644 (file)
@@ -125,7 +125,6 @@ static int ad5504_write_raw(struct iio_dev *indio_dev,
                               long mask)
 {
        struct ad5504_state *st = iio_priv(indio_dev);
-       int ret;
 
        switch (mask) {
        case IIO_CHAN_INFO_RAW:
@@ -134,10 +133,8 @@ static int ad5504_write_raw(struct iio_dev *indio_dev,
 
                return ad5504_spi_write(st, chan->address, val);
        default:
-               ret = -EINVAL;
+               return -EINVAL;
        }
-
-       return -EINVAL;
 }
 
 static const char * const ad5504_powerdown_modes[] = {