Skip to content

Commit 892fbdb

Browse files
ZhangShurongbroonie
authored andcommitted
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: Zhang Shurong <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent b84b531 commit 892fbdb

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

sound/soc/codecs/rt5682-i2c.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,18 +157,18 @@ static int rt5682_i2c_probe(struct i2c_client *i2c)
157157
return ret;
158158
}
159159

160-
ret = devm_add_action_or_reset(&i2c->dev, rt5682_i2c_disable_regulators,
161-
rt5682);
162-
if (ret)
163-
return ret;
164-
165160
ret = regulator_bulk_enable(ARRAY_SIZE(rt5682->supplies),
166161
rt5682->supplies);
167162
if (ret) {
168163
dev_err(&i2c->dev, "Failed to enable supplies: %d\n", ret);
169164
return ret;
170165
}
171166

167+
ret = devm_add_action_or_reset(&i2c->dev, rt5682_i2c_disable_regulators,
168+
rt5682);
169+
if (ret)
170+
return ret;
171+
172172
ret = rt5682_get_ldo1(rt5682, &i2c->dev);
173173
if (ret)
174174
return ret;

0 commit comments

Comments
 (0)