Commit 8dc10114 authored by Chuhong Yuan's avatar Chuhong Yuan Committed by Mark Brown

ASoC: sta32x: add missed function calls in error paths

sta32x_probe() forgets to call undo functions when it fails, add
the missed function calls to fix it.
Signed-off-by: default avatarChuhong Yuan <hslester96@gmail.com>
Link: https://lore.kernel.org/r/20200528102004.911653-1-hslester96@gmail.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent a50067d4
...@@ -893,13 +893,13 @@ static int sta32x_probe(struct snd_soc_component *component) ...@@ -893,13 +893,13 @@ static int sta32x_probe(struct snd_soc_component *component)
sta32x->supplies); sta32x->supplies);
if (ret != 0) { if (ret != 0) {
dev_err(component->dev, "Failed to enable supplies: %d\n", ret); dev_err(component->dev, "Failed to enable supplies: %d\n", ret);
return ret; goto err_clk_disable_unprepare;
} }
ret = sta32x_startup_sequence(sta32x); ret = sta32x_startup_sequence(sta32x);
if (ret < 0) { if (ret < 0) {
dev_err(component->dev, "Failed to startup device\n"); dev_err(component->dev, "Failed to startup device\n");
return ret; goto err_regulator_bulk_disable;
} }
/* CONFA */ /* CONFA */
...@@ -983,6 +983,13 @@ static int sta32x_probe(struct snd_soc_component *component) ...@@ -983,6 +983,13 @@ static int sta32x_probe(struct snd_soc_component *component)
regulator_bulk_disable(ARRAY_SIZE(sta32x->supplies), sta32x->supplies); regulator_bulk_disable(ARRAY_SIZE(sta32x->supplies), sta32x->supplies);
return 0; return 0;
err_regulator_bulk_disable:
regulator_bulk_disable(ARRAY_SIZE(sta32x->supplies), sta32x->supplies);
err_clk_disable_unprepare:
if (sta32x->xti_clk)
clk_disable_unprepare(sta32x->xti_clk);
return ret;
} }
static void sta32x_remove(struct snd_soc_component *component) static void sta32x_remove(struct snd_soc_component *component)
......
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