mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Zheyu Ma <zheyuma97@gmail.com>
To: james.schulman@cirrus.com, david.rhodes@cirrus.com,
	tanureal@opensource.cirrus.com, rf@opensource.cirrus.com,
	lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz,
	tiwai@suse.com, oder_chiou@realtek.com
Cc: alsa-devel@alsa-project.org, patches@opensource.cirrus.com,
	linux-kernel@vger.kernel.org, Zheyu Ma <zheyuma97@gmail.com>
Subject: [PATCH 3/6] ASoC: rt5645: Fix the error handling of rt5645_i2c_probe()
Date: Tue, 10 May 2022 23:32:48 +0800	[thread overview]
Message-ID: <20220510153251.1741210-4-zheyuma97@gmail.com> (raw)
In-Reply-To: <20220510153251.1741210-1-zheyuma97@gmail.com>

After enabling the regulator, The driver should disable the regulator
when failing at probing.

Signed-off-by: Zheyu Ma <zheyuma97@gmail.com>
---
 sound/soc/codecs/rt5645.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c
index 1518eb7e9201..ccdea234a3ba 100644
--- a/sound/soc/codecs/rt5645.c
+++ b/sound/soc/codecs/rt5645.c
@@ -3943,7 +3943,7 @@ static int rt5645_i2c_probe(struct i2c_client *i2c)
 		ret = PTR_ERR(regmap);
 		dev_err(&i2c->dev, "Failed to allocate temp register map: %d\n",
 			ret);
-		return ret;
+		goto err_enable;
 	}
 
 	/*
@@ -3974,7 +3974,7 @@ static int rt5645_i2c_probe(struct i2c_client *i2c)
 		ret = PTR_ERR(rt5645->regmap);
 		dev_err(&i2c->dev, "Failed to allocate register map: %d\n",
 			ret);
-		return ret;
+		goto err_enable;
 	}
 
 	regmap_write(rt5645->regmap, RT5645_RESET, 0);
-- 
2.25.1


  parent reply	other threads:[~2022-05-10 15:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-10 15:32 [PATCH 0/6] ASOC: Fix the error handling code of the probe Zheyu Ma
2022-05-10 15:32 ` [PATCH 1/6] ASoC: cs42l52: Fix the error handling of cs42l56_i2c_probe() Zheyu Ma
2022-05-10 15:54   ` Charles Keepax
2022-05-11  1:55     ` [PATCH v2] ASoC: cs42l56: " Zheyu Ma
2022-05-11  8:19       ` Charles Keepax
2022-05-10 15:32 ` [PATCH 2/6] ASoC: cs35l36: Fix the error handling of cs35l36_i2c_probe() Zheyu Ma
2022-05-10 15:55   ` Charles Keepax
2022-05-10 15:32 ` Zheyu Ma [this message]
2022-05-10 15:32 ` [PATCH 4/6] ASoC: tas571x: Fix the error handling of tas571x_i2c_probe() Zheyu Ma
2022-05-10 15:32 ` [PATCH 5/6] ASoC: tas6424: Fix the error handling of tas6424_i2c_probe() Zheyu Ma
2022-05-10 15:32 ` [PATCH 6/6] ASoC: wm8903: Fix the error handling of wm8903_i2c_probe() Zheyu Ma
2022-05-10 15:56   ` Charles Keepax
2022-05-12 14:12 ` [PATCH 0/6] ASOC: Fix the error handling code of the probe 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=20220510153251.1741210-4-zheyuma97@gmail.com \
    --to=zheyuma97@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=david.rhodes@cirrus.com \
    --cc=james.schulman@cirrus.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oder_chiou@realtek.com \
    --cc=patches@opensource.cirrus.com \
    --cc=perex@perex.cz \
    --cc=rf@opensource.cirrus.com \
    --cc=tanureal@opensource.cirrus.com \
    --cc=tiwai@suse.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

all inboxes | Powered by JetHome®