Commit 17cf9fae authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Mark Brown

ASoC: rt5682s: Use the devm_clk_get_optional() helper

Use devm_clk_get_optional() instead of hand writing it.
This saves some LoC and improves the semantic.
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/f538c24ad7b1926478347a03b5b7f0432e195e3b.1684594691.git.christophe.jaillet@wanadoo.frSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 0b855cbb
......@@ -2848,14 +2848,9 @@ static int rt5682s_dai_probe_clks(struct snd_soc_component *component)
int ret;
/* Check if MCLK provided */
rt5682s->mclk = devm_clk_get(component->dev, "mclk");
if (IS_ERR(rt5682s->mclk)) {
if (PTR_ERR(rt5682s->mclk) != -ENOENT) {
ret = PTR_ERR(rt5682s->mclk);
return ret;
}
rt5682s->mclk = NULL;
}
rt5682s->mclk = devm_clk_get_optional(component->dev, "mclk");
if (IS_ERR(rt5682s->mclk))
return PTR_ERR(rt5682s->mclk);
/* Register CCF DAI clock control */
ret = rt5682s_register_dai_clks(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