Message ID | 20250318-iio-adc-ad7606-improvements-v2-2-4b605427774c@baylibre.com (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
Series | iio: adc: ad7606: improvements and ad7606c parallel interface support | expand |
On Tue, 18 Mar 2025 17:52:10 -0500 David Lechner <dlechner@baylibre.com> wrote: > 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> Applied to the togreg branch of iio.git. For now pushed out as testing. I'll rebase on rc1 before pushing it out as a non rebasing branch. Thanks, Jonathan > --- > drivers/iio/adc/ad7606_spi.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > diff --git a/drivers/iio/adc/ad7606_spi.c b/drivers/iio/adc/ad7606_spi.c > index 885bf0b68e7775c5f4a12dfb827f502d5f782e8c..c028e08efe2c82cd97249f98eec50a9a9c06471f 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 >
diff --git a/drivers/iio/adc/ad7606_spi.c b/drivers/iio/adc/ad7606_spi.c index 885bf0b68e7775c5f4a12dfb827f502d5f782e8c..c028e08efe2c82cd97249f98eec50a9a9c06471f 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