summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>2021-10-26 10:10:30 +0200
committerMark Brown <broonie@kernel.org>2021-10-27 15:57:15 +0100
commit709d297503e64ec3804b3b8150628656db164d4b (patch)
tree7c1bf510ffe36b972059d928f0ef1082c4312053
parent63ff4c50ac5667f697799d780c0fe7b74585e28b (diff)
downloadlinux-stable-709d297503e64ec3804b3b8150628656db164d4b.tar.gz
linux-stable-709d297503e64ec3804b3b8150628656db164d4b.tar.bz2
linux-stable-709d297503e64ec3804b3b8150628656db164d4b.zip
ASoC: rt5682-i2c: Use devm_clk_get_optional for optional clock
The mclk clock is optional, but it's currently using devm_clk_get: simplify the handling by using devm_clk_get_optional instead. Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20211026081030.422481-1-angelogioacchino.delregno@collabora.com Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/codecs/rt5682-i2c.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/sound/soc/codecs/rt5682-i2c.c b/sound/soc/codecs/rt5682-i2c.c
index a30e42932cf7..983347b65127 100644
--- a/sound/soc/codecs/rt5682-i2c.c
+++ b/sound/soc/codecs/rt5682-i2c.c
@@ -280,14 +280,9 @@ static int rt5682_i2c_probe(struct i2c_client *i2c,
#ifdef CONFIG_COMMON_CLK
/* Check if MCLK provided */
- rt5682->mclk = devm_clk_get(&i2c->dev, "mclk");
- if (IS_ERR(rt5682->mclk)) {
- if (PTR_ERR(rt5682->mclk) != -ENOENT) {
- ret = PTR_ERR(rt5682->mclk);
- return ret;
- }
- rt5682->mclk = NULL;
- }
+ rt5682->mclk = devm_clk_get_optional(&i2c->dev, "mclk");
+ if (IS_ERR(rt5682->mclk))
+ return PTR_ERR(rt5682->mclk);
/* Register CCF DAI clock control */
ret = rt5682_register_dai_clks(rt5682);