1
0
Fork 0

iio: adc: ad799x: fix probe error handling

Since commit 0f7ddcc1bf ("iio:adc:ad799x: Write default config on probe
and reset alert status on probe") the error path is wrong since it
leaves the vref regulator on. Fix this by disabling both regulators.

Fixes: 0f7ddcc1bf ("iio:adc:ad799x: Write default config on probe and reset alert status on probe")
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
alistair/sunxi64-5.4-dsi
Marco Felsch 2019-09-17 18:09:23 +02:00 committed by Jonathan Cameron
parent 7fd1c26065
commit c62dd44901
1 changed files with 2 additions and 2 deletions

View File

@ -810,10 +810,10 @@ static int ad799x_probe(struct i2c_client *client,
ret = ad799x_write_config(st, st->chip_config->default_config);
if (ret < 0)
goto error_disable_reg;
goto error_disable_vref;
ret = ad799x_read_config(st);
if (ret < 0)
goto error_disable_reg;
goto error_disable_vref;
st->config = ret;
ret = iio_triggered_buffer_setup(indio_dev, NULL,