diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2023-05-20 17:56:00 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2023-05-22 13:18:54 +0300 |
commit | f364eb563164f52dcc42ea265a66510c6f15f829 (patch) | |
tree | 81c9a0ea0bced3983d084181103559cad6b5312b /sound/soc/codecs/rt5659.c | |
parent | c0998e0142af8037e4a0ee84dd01cd20cbe0c76e (diff) | |
download | linux-f364eb563164f52dcc42ea265a66510c6f15f829.tar.xz |
ASoC: rt5659: 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/5b44b2fddd8973e949e4ae2132971b147cfd1ec1.1684594544.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/rt5659.c')
-rw-r--r-- | sound/soc/codecs/rt5659.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/sound/soc/codecs/rt5659.c b/sound/soc/codecs/rt5659.c index 22bb57029bc0..df6f0d769bbd 100644 --- a/sound/soc/codecs/rt5659.c +++ b/sound/soc/codecs/rt5659.c @@ -4141,13 +4141,9 @@ static int rt5659_i2c_probe(struct i2c_client *i2c) regmap_write(rt5659->regmap, RT5659_RESET, 0); /* Check if MCLK provided */ - rt5659->mclk = devm_clk_get(&i2c->dev, "mclk"); - if (IS_ERR(rt5659->mclk)) { - if (PTR_ERR(rt5659->mclk) != -ENOENT) - return PTR_ERR(rt5659->mclk); - /* Otherwise mark the mclk pointer to NULL */ - rt5659->mclk = NULL; - } + rt5659->mclk = devm_clk_get_optional(&i2c->dev, "mclk"); + if (IS_ERR(rt5659->mclk)) + return PTR_ERR(rt5659->mclk); rt5659_calibrate(rt5659); |