* [PATCH] iio: sca3000: Fix missing return in switch
@ 2018-07-07 17:44 Gustavo A. R. Silva
2018-07-08 11:05 ` Jonathan Cameron
0 siblings, 1 reply; 2+ messages in thread
From: Gustavo A. R. Silva @ 2018-07-07 17:44 UTC (permalink / raw)
To: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
Peter Meerwald-Stadler
Cc: linux-iio, linux-kernel, Gustavo A. R. Silva
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(+)
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;
}
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] iio: sca3000: Fix missing return in switch
2018-07-07 17:44 [PATCH] iio: sca3000: Fix missing return in switch Gustavo A. R. Silva
@ 2018-07-08 11:05 ` Jonathan Cameron
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2018-07-08 11:05 UTC (permalink / raw)
To: Gustavo A. R. Silva
Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
linux-iio, linux-kernel
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;
> }
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-07-08 11:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-07 17:44 [PATCH] iio: sca3000: Fix missing return in switch Gustavo A. R. Silva
2018-07-08 11:05 ` Jonathan Cameron
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.