linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marco Felsch <m.felsch@pengutronix.de>
To: michael.hennerich@analog.com, lars@metafoo.de,
	stefan.popa@analog.com, jic23@kernel.org, knaack.h@gmx.de,
	pmeerw@pmeerw.net
Cc: linux-iio@vger.kernel.org, kernel@pengutronix.de
Subject: [PATCH 1/3] iio: adc: ad799x: fix probe error handling
Date: Tue, 17 Sep 2019 18:09:23 +0200	[thread overview]
Message-ID: <20190917160925.9791-2-m.felsch@pengutronix.de> (raw)
In-Reply-To: <20190917160925.9791-1-m.felsch@pengutronix.de>

Since commit 0f7ddcc1bff1 ("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: 0f7ddcc1bff1 ("iio:adc:ad799x: Write default config on probe and
reset alert status on probe")
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
---
 drivers/iio/adc/ad799x.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/adc/ad799x.c b/drivers/iio/adc/ad799x.c
index 5a3ca5904ded..f658012baad8 100644
--- a/drivers/iio/adc/ad799x.c
+++ b/drivers/iio/adc/ad799x.c
@@ -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,
-- 
2.20.1


  reply	other threads:[~2019-09-17 16:09 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-17 16:09 [PATCH 0/3] ADC AD799x improvements Marco Felsch
2019-09-17 16:09 ` Marco Felsch [this message]
2019-09-18  6:29   ` [PATCH 1/3] iio: adc: ad799x: fix probe error handling Ardelean, Alexandru
2019-10-05 12:38     ` Jonathan Cameron
2019-09-17 16:09 ` [PATCH 2/3] iio: adc: ad799x: factor out config register update Marco Felsch
2019-09-18  6:51   ` Ardelean, Alexandru
2019-09-18  8:52     ` Marco Felsch
2019-09-18 10:17       ` Ardelean, Alexandru
2019-09-17 16:09 ` [PATCH 3/3] iio: adc: ad799x: add pm_ops to disable the device completely Marco Felsch
2019-09-18  6:59   ` Ardelean, Alexandru
2019-09-18  8:37     ` Marco Felsch
2019-09-18  7:00 ` [PATCH 0/3] ADC AD799x improvements Ardelean, Alexandru
2019-09-18  8:22   ` Marco Felsch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190917160925.9791-2-m.felsch@pengutronix.de \
    --to=m.felsch@pengutronix.de \
    --cc=jic23@kernel.org \
    --cc=kernel@pengutronix.de \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=michael.hennerich@analog.com \
    --cc=pmeerw@pmeerw.net \
    --cc=stefan.popa@analog.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).