Commit ef1878fd authored by Zheyu Ma's avatar Zheyu Ma Committed by Mark Brown

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: default avatarZheyu Ma <zheyuma97@gmail.com>
Link: https://lore.kernel.org/r/20220510153251.1741210-5-zheyuma97@gmail.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 7883c193
...@@ -833,7 +833,8 @@ static int tas571x_i2c_probe(struct i2c_client *client) ...@@ -833,7 +833,8 @@ static int tas571x_i2c_probe(struct i2c_client *client)
if (IS_ERR(priv->pdn_gpio)) { if (IS_ERR(priv->pdn_gpio)) {
dev_err(dev, "error requesting pdn_gpio: %ld\n", dev_err(dev, "error requesting pdn_gpio: %ld\n",
PTR_ERR(priv->pdn_gpio)); 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", priv->reset_gpio = devm_gpiod_get_optional(dev, "reset",
...@@ -841,7 +842,8 @@ static int tas571x_i2c_probe(struct i2c_client *client) ...@@ -841,7 +842,8 @@ static int tas571x_i2c_probe(struct i2c_client *client)
if (IS_ERR(priv->reset_gpio)) { if (IS_ERR(priv->reset_gpio)) {
dev_err(dev, "error requesting reset_gpio: %ld\n", dev_err(dev, "error requesting reset_gpio: %ld\n",
PTR_ERR(priv->reset_gpio)); 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) { } else if (priv->reset_gpio) {
/* pulse the active low reset line for ~100us */ /* pulse the active low reset line for ~100us */
usleep_range(100, 200); usleep_range(100, 200);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment