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 4/6] ASoC: tas571x: Fix the error handling of tas571x_i2c_probe() Date: Tue, 10 May 2022 23:32:49 +0800 [thread overview] Message-ID: <20220510153251.1741210-5-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/tas571x.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/tas571x.c b/sound/soc/codecs/tas571x.c index dd289774efb2..7b599664db20 100644 --- a/sound/soc/codecs/tas571x.c +++ b/sound/soc/codecs/tas571x.c @@ -833,7 +833,8 @@ static int tas571x_i2c_probe(struct i2c_client *client) if (IS_ERR(priv->pdn_gpio)) { dev_err(dev, "error requesting pdn_gpio: %ld\n", PTR_ERR(priv->pdn_gpio)); - return PTR_ERR(priv->pdn_gpio); + ret = PTR_ERR(priv->pdn_gpio); + goto disable_regs; } priv->reset_gpio = devm_gpiod_get_optional(dev, "reset", @@ -841,7 +842,8 @@ static int tas571x_i2c_probe(struct i2c_client *client) if (IS_ERR(priv->reset_gpio)) { dev_err(dev, "error requesting reset_gpio: %ld\n", PTR_ERR(priv->reset_gpio)); - return PTR_ERR(priv->reset_gpio); + ret = PTR_ERR(priv->reset_gpio); + goto disable_regs; } else if (priv->reset_gpio) { /* pulse the active low reset line for ~100us */ usleep_range(100, 200); -- 2.25.1
WARNING: multiple messages have this Message-ID (diff)
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: patches@opensource.cirrus.com, alsa-devel@alsa-project.org, Zheyu Ma <zheyuma97@gmail.com>, linux-kernel@vger.kernel.org Subject: [PATCH 4/6] ASoC: tas571x: Fix the error handling of tas571x_i2c_probe() Date: Tue, 10 May 2022 23:32:49 +0800 [thread overview] Message-ID: <20220510153251.1741210-5-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/tas571x.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/tas571x.c b/sound/soc/codecs/tas571x.c index dd289774efb2..7b599664db20 100644 --- a/sound/soc/codecs/tas571x.c +++ b/sound/soc/codecs/tas571x.c @@ -833,7 +833,8 @@ static int tas571x_i2c_probe(struct i2c_client *client) if (IS_ERR(priv->pdn_gpio)) { dev_err(dev, "error requesting pdn_gpio: %ld\n", PTR_ERR(priv->pdn_gpio)); - return PTR_ERR(priv->pdn_gpio); + ret = PTR_ERR(priv->pdn_gpio); + goto disable_regs; } priv->reset_gpio = devm_gpiod_get_optional(dev, "reset", @@ -841,7 +842,8 @@ static int tas571x_i2c_probe(struct i2c_client *client) if (IS_ERR(priv->reset_gpio)) { dev_err(dev, "error requesting reset_gpio: %ld\n", PTR_ERR(priv->reset_gpio)); - return PTR_ERR(priv->reset_gpio); + ret = PTR_ERR(priv->reset_gpio); + goto disable_regs; } else if (priv->reset_gpio) { /* pulse the active low reset line for ~100us */ usleep_range(100, 200); -- 2.25.1
next prev parent reply other threads:[~2022-05-10 15:34 UTC|newest] Thread overview: 25+ 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 ` 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:32 ` Zheyu Ma 2022-05-10 15:54 ` Charles Keepax 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-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:32 ` Zheyu Ma 2022-05-10 15:55 ` Charles Keepax 2022-05-10 15:55 ` Charles Keepax 2022-05-10 15:32 ` [PATCH 3/6] ASoC: rt5645: Fix the error handling of rt5645_i2c_probe() Zheyu Ma 2022-05-10 15:32 ` Zheyu Ma 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 ` 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:32 ` Zheyu Ma 2022-05-10 15:56 ` Charles Keepax 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 2022-05-12 14:12 ` 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-5-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: linkBe 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.