All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabio Estevam <festevam@gmail.com>
To: jic23@kernel.org
Cc: B38611@freescale.com, linux-iio@vger.kernel.org,
	Fabio Estevam <fabio.estevam@freescale.com>
Subject: [PATCH 3/5] iio: adc: vf610: Disable the regulator on error
Date: Thu,  2 Oct 2014 22:25:24 -0300	[thread overview]
Message-ID: <1412299526-1331-3-git-send-email-festevam@gmail.com> (raw)
In-Reply-To: <1412299526-1331-1-git-send-email-festevam@gmail.com>

From: Fabio Estevam <fabio.estevam@freescale.com>

If clk_prepare_enable() fails we should disable the regulator that was 
previously enabled.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 drivers/iio/adc/vf610_adc.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/iio/adc/vf610_adc.c b/drivers/iio/adc/vf610_adc.c
index a9c41ec..ae56753 100644
--- a/drivers/iio/adc/vf610_adc.c
+++ b/drivers/iio/adc/vf610_adc.c
@@ -680,11 +680,15 @@ static int vf610_adc_resume(struct device *dev)
 
 	ret = clk_prepare_enable(info->clk);
 	if (ret)
-		return ret;
+		goto disable_reg;
 
 	vf610_adc_hw_init(info);
 
 	return 0;
+
+disable_reg:
+	regulator_disable(info->vref);
+	return ret;
 }
 #endif
 
-- 
1.9.1


  parent reply	other threads:[~2014-10-03  1:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-03  1:25 [PATCH 1/5] iio: adc: vf610: Propagate the real error when platform_get_irq() fails Fabio Estevam
2014-10-03  1:25 ` [PATCH 2/5] iio: adc: vf610: Return the error code directly Fabio Estevam
2014-10-04 11:28   ` Jonathan Cameron
2014-10-03  1:25 ` Fabio Estevam [this message]
2014-10-04 11:30   ` [PATCH 3/5] iio: adc: vf610: Disable the regulator on error Jonathan Cameron
2014-10-03  1:25 ` [PATCH 4/5] iio: adc: vf610: SIMPLE_DEV_PM_OPS can fit on a single line Fabio Estevam
2014-10-04 11:31   ` Jonathan Cameron
2014-10-03  1:25 ` [PATCH 5/5] iio: adc: vf610: Remove CONFIG_PM_SLEEP ifdef's Fabio Estevam
2014-10-04 11:34   ` Jonathan Cameron
2014-10-04 11:26 ` [PATCH 1/5] iio: adc: vf610: Propagate the real error when platform_get_irq() fails Jonathan Cameron
2014-10-04 18:46   ` Fabio Estevam
2014-10-09 19:57     ` Jonathan Cameron
2014-10-09 19:59     ` Jonathan Cameron

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=1412299526-1331-3-git-send-email-festevam@gmail.com \
    --to=festevam@gmail.com \
    --cc=B38611@freescale.com \
    --cc=fabio.estevam@freescale.com \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.