summaryrefslogtreecommitdiffstats
path: root/drivers/iio/accel
diff options
context:
space:
mode:
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>2018-04-08 21:44:15 +0200
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2018-04-15 21:18:25 +0200
commitda2d54494c56339dc8ebd9093d332b23933dc2a3 (patch)
tree6d713a9b8dc95eed242a4e87f531ef1a7a2cc7dc /drivers/iio/accel
parentiio: sca3000: Fix an error handling path in 'sca3000_probe()' (diff)
downloadlinux-da2d54494c56339dc8ebd9093d332b23933dc2a3.tar.xz
linux-da2d54494c56339dc8ebd9093d332b23933dc2a3.zip
iio: sca3000: Handle errors returned by 'sca3000_configure_ring()' in 'sca3000_probe()'
'sca3000_configure_ring()' can fail, so test its return value and propagate it if needed. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/accel')
-rw-r--r--drivers/iio/accel/sca3000.c4
1 files changed, 3 insertions, 1 deletions
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,