Commit ac0a6899 authored by Matthias Reichl's avatar Matthias Reichl Committed by Mark Brown

ASoC: pcm512x: Fix unbalanced regulator enable call in probe error path

When we get a clock error during probe we have to call
regulator_bulk_disable before bailing out, otherwise we trigger
a warning in regulator_put.

Fix this by using "goto err" like in the error cases above.

Fixes: 5a3af129 ("ASoC: pcm512x: Add PCM512x driver")
Signed-off-by: default avatarMatthias Reichl <hias@horus.com>
Reviewed-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200220202956.29233-1-hias@horus.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 63d68382
...@@ -1564,13 +1564,15 @@ int pcm512x_probe(struct device *dev, struct regmap *regmap) ...@@ -1564,13 +1564,15 @@ int pcm512x_probe(struct device *dev, struct regmap *regmap)
} }
pcm512x->sclk = devm_clk_get(dev, NULL); pcm512x->sclk = devm_clk_get(dev, NULL);
if (PTR_ERR(pcm512x->sclk) == -EPROBE_DEFER) if (PTR_ERR(pcm512x->sclk) == -EPROBE_DEFER) {
return -EPROBE_DEFER; ret = -EPROBE_DEFER;
goto err;
}
if (!IS_ERR(pcm512x->sclk)) { if (!IS_ERR(pcm512x->sclk)) {
ret = clk_prepare_enable(pcm512x->sclk); ret = clk_prepare_enable(pcm512x->sclk);
if (ret != 0) { if (ret != 0) {
dev_err(dev, "Failed to enable SCLK: %d\n", ret); dev_err(dev, "Failed to enable SCLK: %d\n", ret);
return ret; goto err;
} }
} }
......
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