iio: sca3000: Fix missing return in switch
authorGustavo A. R. Silva <gustavo@embeddedor.com>
Sat, 7 Jul 2018 17:44:01 +0000 (12:44 -0500)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Tue, 24 Jul 2018 17:17:18 +0000 (18:17 +0100)
The IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY case is missing a
return and will fall through to the default case and errorenously
return -EINVAL.

Fix this by adding in missing *return ret*.

Fixes: 626f971b5b07 ("staging:iio:accel:sca3000 Add write support to the low pass filter control")
Reported-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/accel/sca3000.c

index 4dceb75e35862136de6a0f444f92913d1a4bbdaf..4964561595f5956aecbabcb3f0cbbfa809cf40fd 100644 (file)
@@ -797,6 +797,7 @@ static int sca3000_write_raw(struct iio_dev *indio_dev,
                mutex_lock(&st->lock);
                ret = sca3000_write_3db_freq(st, val);
                mutex_unlock(&st->lock);
+               return ret;
        default:
                return -EINVAL;
        }