Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Fabio Estevam <festevam@gmail.com>
To: broonie@kernel.org
Cc: Fabio Estevam <fabio.estevam@nxp.com>,
	ckeepax@opensource.wolfsonmicro.com, alsa-devel@alsa-project.org
Subject: [PATCH 1/2] ASoC: wm8962: Disable clock if wm8962_runtime_resume() fails
Date: Mon, 28 Mar 2016 08:31:18 -0300	[thread overview]
Message-ID: <1459164679-17961-1-git-send-email-festevam@gmail.com> (raw)

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

When regulator_bulk_enable() fails inside wm8962_runtime_resume(),
we should disable the previously enabled clock.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
---
 sound/soc/codecs/wm8962.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c
index 8822360..f3f71ba 100644
--- a/sound/soc/codecs/wm8962.c
+++ b/sound/soc/codecs/wm8962.c
@@ -3800,7 +3800,7 @@ static int wm8962_runtime_resume(struct device *dev)
 	if (ret != 0) {
 		dev_err(dev,
 			"Failed to enable supplies: %d\n", ret);
-		return ret;
+		goto disable_clock;
 	}
 
 	regcache_cache_only(wm8962->regmap, false);
@@ -3838,6 +3838,10 @@ static int wm8962_runtime_resume(struct device *dev)
 	msleep(5);
 
 	return 0;
+
+disable_clock:
+	clk_disable_unprepare(wm8962->pdata.mclk);
+	return ret;
 }
 
 static int wm8962_runtime_suspend(struct device *dev)
-- 
1.9.1

             reply	other threads:[~2016-03-28 11:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-28 11:31 Fabio Estevam [this message]
2016-03-28 11:31 ` [PATCH 2/2] ASoC: wm8962: Fit error message into a single line Fabio Estevam
2016-03-28 12:57   ` Charles Keepax
2016-03-29 17:08   ` Applied "ASoC: wm8962: Fit error message into a single line" to the asoc tree Mark Brown
2016-03-28 12:56 ` [PATCH 1/2] ASoC: wm8962: Disable clock if wm8962_runtime_resume() fails Charles Keepax
2016-03-29 17:08 ` Applied "ASoC: wm8962: Disable clock if wm8962_runtime_resume() fails" to the asoc tree Mark Brown

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=1459164679-17961-1-git-send-email-festevam@gmail.com \
    --to=festevam@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=ckeepax@opensource.wolfsonmicro.com \
    --cc=fabio.estevam@nxp.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