Skip to content

Commit ac0a689

Browse files
HiassofTbroonie
authored andcommitted
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: 5a3af12 ("ASoC: pcm512x: Add PCM512x driver") Signed-off-by: Matthias Reichl <[email protected]> Reviewed-by: Pierre-Louis Bossart <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 63d6838 commit ac0a689

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

sound/soc/codecs/pcm512x.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1564,13 +1564,15 @@ int pcm512x_probe(struct device *dev, struct regmap *regmap)
15641564
}
15651565

15661566
pcm512x->sclk = devm_clk_get(dev, NULL);
1567-
if (PTR_ERR(pcm512x->sclk) == -EPROBE_DEFER)
1568-
return -EPROBE_DEFER;
1567+
if (PTR_ERR(pcm512x->sclk) == -EPROBE_DEFER) {
1568+
ret = -EPROBE_DEFER;
1569+
goto err;
1570+
}
15691571
if (!IS_ERR(pcm512x->sclk)) {
15701572
ret = clk_prepare_enable(pcm512x->sclk);
15711573
if (ret != 0) {
15721574
dev_err(dev, "Failed to enable SCLK: %d\n", ret);
1573-
return ret;
1575+
goto err;
15741576
}
15751577
}
15761578

0 commit comments

Comments
 (0)