diff mbox

iio: sca3000: Fix missing return in switch

Message ID 20180707174401.GA11730@embeddedor.com (mailing list archive)
State New, archived
Headers show

Commit Message

Gustavo A. R. Silva July 7, 2018, 5:44 p.m. UTC
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>
---
 drivers/iio/accel/sca3000.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Jonathan Cameron July 8, 2018, 11:05 a.m. UTC | #1
On Sat, 7 Jul 2018 12:44:01 -0500
"Gustavo A. R. Silva" <gustavo@embeddedor.com> wrote:

> 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>

Thanks, Applied to the fixes-togreg branch of iio.git, marked for stable.

Jonathan
> ---
>  drivers/iio/accel/sca3000.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/iio/accel/sca3000.c b/drivers/iio/accel/sca3000.c
> index 4dceb75..4964561 100644
> --- a/drivers/iio/accel/sca3000.c
> +++ b/drivers/iio/accel/sca3000.c
> @@ -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;
>  	}

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/iio/accel/sca3000.c b/drivers/iio/accel/sca3000.c
index 4dceb75..4964561 100644
--- a/drivers/iio/accel/sca3000.c
+++ b/drivers/iio/accel/sca3000.c
@@ -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;
 	}