diff mbox

[v2,2/2] iio: sca3000: Handle errors returned by 'sca3000_configure_ring()' in 'sca3000_probe()'

Message ID 20180408194415.18399-1-christophe.jaillet@wanadoo.fr (mailing list archive)
State New, archived
Headers show

Commit Message

Christophe JAILLET April 8, 2018, 7:44 p.m. UTC
'sca3000_configure_ring()' can fail, so test its return value and
propagate it if needed.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
Same as v1
---
 drivers/iio/accel/sca3000.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Jonathan Cameron April 15, 2018, 7:19 p.m. UTC | #1
On Sun,  8 Apr 2018 21:44:15 +0200
Christophe JAILLET <christophe.jaillet@wanadoo.fr> wrote:

> 'sca3000_configure_ring()' can fail, so test its return value and
> propagate it if needed.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Applied to the togreg branch of iio.git and pushed out as testing
for the autobuilders to play with it.  Thanks,

Jonathan

> ---
> Same as v1
> ---
>  drivers/iio/accel/sca3000.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/accel/sca3000.c b/drivers/iio/accel/sca3000.c
> index 562f125235db..4dceb75e3586 100644
> --- a/drivers/iio/accel/sca3000.c
> +++ b/drivers/iio/accel/sca3000.c
> @@ -1481,7 +1481,9 @@ static int sca3000_probe(struct spi_device *spi)
>  	}
>  	indio_dev->modes = INDIO_DIRECT_MODE;
>  
> -	sca3000_configure_ring(indio_dev);
> +	ret = sca3000_configure_ring(indio_dev);
> +	if (ret)
> +		return ret;
>  
>  	if (spi->irq) {
>  		ret = request_threaded_irq(spi->irq,

--
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 562f125235db..4dceb75e3586 100644
--- a/drivers/iio/accel/sca3000.c
+++ b/drivers/iio/accel/sca3000.c
@@ -1481,7 +1481,9 @@  static int sca3000_probe(struct spi_device *spi)
 	}
 	indio_dev->modes = INDIO_DIRECT_MODE;
 
-	sca3000_configure_ring(indio_dev);
+	ret = sca3000_configure_ring(indio_dev);
+	if (ret)
+		return ret;
 
 	if (spi->irq) {
 		ret = request_threaded_irq(spi->irq,