diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2023-05-20 16:58:24 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2023-05-22 12:18:57 +0200 |
commit | 17cf9faeba463d24e7c497ff8137a8c8414644dc (patch) | |
tree | 43567add73405a9b454d9b834ece217a3e201212 /sound/soc/codecs/rt5682s.c | |
parent | ASoC: cs53l30: Use the devm_clk_get_optional() helper (diff) | |
download | linux-17cf9faeba463d24e7c497ff8137a8c8414644dc.tar.xz linux-17cf9faeba463d24e7c497ff8137a8c8414644dc.zip |
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: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/f538c24ad7b1926478347a03b5b7f0432e195e3b.1684594691.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/rt5682s.c')
-rw-r--r-- | sound/soc/codecs/rt5682s.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/sound/soc/codecs/rt5682s.c b/sound/soc/codecs/rt5682s.c index 81163b026b9e..a01de405c22c 100644 --- a/sound/soc/codecs/rt5682s.c +++ b/sound/soc/codecs/rt5682s.c @@ -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); |