Commit 892fbdb2 authored by Zhang Shurong's avatar Zhang Shurong Committed by Mark Brown

ASoC: rt5682: Fix regulator enable/disable sequence

This will attempt to disable the regulators if the initial enable fails
which is a bug.

Fix this bug by modifying the code to the correct sequence.
Signed-off-by: default avatarZhang Shurong <zhang_shurong@foxmail.com>
Link: https://lore.kernel.org/r/tencent_4F37C9B5315B7960041E8E0ADDA869128F08@qq.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent b84b5314
...@@ -157,11 +157,6 @@ static int rt5682_i2c_probe(struct i2c_client *i2c) ...@@ -157,11 +157,6 @@ static int rt5682_i2c_probe(struct i2c_client *i2c)
return ret; return ret;
} }
ret = devm_add_action_or_reset(&i2c->dev, rt5682_i2c_disable_regulators,
rt5682);
if (ret)
return ret;
ret = regulator_bulk_enable(ARRAY_SIZE(rt5682->supplies), ret = regulator_bulk_enable(ARRAY_SIZE(rt5682->supplies),
rt5682->supplies); rt5682->supplies);
if (ret) { if (ret) {
...@@ -169,6 +164,11 @@ static int rt5682_i2c_probe(struct i2c_client *i2c) ...@@ -169,6 +164,11 @@ static int rt5682_i2c_probe(struct i2c_client *i2c)
return ret; return ret;
} }
ret = devm_add_action_or_reset(&i2c->dev, rt5682_i2c_disable_regulators,
rt5682);
if (ret)
return ret;
ret = rt5682_get_ldo1(rt5682, &i2c->dev); ret = rt5682_get_ldo1(rt5682, &i2c->dev);
if (ret) if (ret)
return ret; return ret;
......
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