diff options
author | Zheyu Ma <zheyuma97@gmail.com> | 2022-05-10 17:32:49 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2022-05-11 18:40:15 +0200 |
commit | ef1878fd0cd61f0f3fafdf518bb8f1df742ef760 (patch) | |
tree | ca9f927d83e293f7254afd9bf53d41cc910d95cc /sound/soc/codecs/tas571x.c | |
parent | ASoC: rt5645: Fix the error handling of rt5645_i2c_probe() (diff) | |
download | linux-ef1878fd0cd61f0f3fafdf518bb8f1df742ef760.tar.xz linux-ef1878fd0cd61f0f3fafdf518bb8f1df742ef760.zip |
ASoC: tas571x: Fix the error handling of tas571x_i2c_probe()
After enabling the regulator, The driver should disable the regulator
when failing at probing.
Signed-off-by: Zheyu Ma <zheyuma97@gmail.com>
Link: https://lore.kernel.org/r/20220510153251.1741210-5-zheyuma97@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/tas571x.c')
-rw-r--r-- | sound/soc/codecs/tas571x.c | 6 |
1 files 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); |