summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Lechner <dlechner@baylibre.com>2025-03-18 17:52:10 -0500
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2025-04-22 19:09:54 +0100
commit4d71bf6021818a039a534c5954acefdfc4d6962c (patch)
tree8d36638d18fad917d2f7fb7c7fb73087825d6b40
parent868fb0708087a9583cbf33ebc15eb6d2898b8787 (diff)
iio: adc: ad7606_spi: check error in ad7606B_sw_mode_config()
Add missing error check in ad7606B_sw_mode_config(). Reviewed-by: Nuno Sá <nuno.sa@analog.com> Signed-off-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20250318-iio-adc-ad7606-improvements-v2-2-4b605427774c@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-rw-r--r--drivers/iio/adc/ad7606_spi.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/iio/adc/ad7606_spi.c b/drivers/iio/adc/ad7606_spi.c
index 885bf0b68e777..c028e08efe2c8 100644
--- a/drivers/iio/adc/ad7606_spi.c
+++ b/drivers/iio/adc/ad7606_spi.c
@@ -174,11 +174,13 @@ static int ad7616_sw_mode_config(struct iio_dev *indio_dev)
static int ad7606B_sw_mode_config(struct iio_dev *indio_dev)
{
struct ad7606_state *st = iio_priv(indio_dev);
+ int ret;
/* Configure device spi to output on a single channel */
- st->bops->reg_write(st,
- AD7606_CONFIGURATION_REGISTER,
- AD7606_SINGLE_DOUT);
+ ret = st->bops->reg_write(st, AD7606_CONFIGURATION_REGISTER,
+ AD7606_SINGLE_DOUT);
+ if (ret)
+ return ret;
/*
* Scale can be configured individually for each channel