Commit 709d2975 authored by AngeloGioacchino Del Regno's avatar AngeloGioacchino Del Regno Committed by Mark Brown

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: default avatarAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20211026081030.422481-1-angelogioacchino.delregno@collabora.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 63ff4c50
...@@ -280,14 +280,9 @@ static int rt5682_i2c_probe(struct i2c_client *i2c, ...@@ -280,14 +280,9 @@ static int rt5682_i2c_probe(struct i2c_client *i2c,
#ifdef CONFIG_COMMON_CLK #ifdef CONFIG_COMMON_CLK
/* Check if MCLK provided */ /* Check if MCLK provided */
rt5682->mclk = devm_clk_get(&i2c->dev, "mclk"); rt5682->mclk = devm_clk_get_optional(&i2c->dev, "mclk");
if (IS_ERR(rt5682->mclk)) { if (IS_ERR(rt5682->mclk))
if (PTR_ERR(rt5682->mclk) != -ENOENT) { return PTR_ERR(rt5682->mclk);
ret = PTR_ERR(rt5682->mclk);
return ret;
}
rt5682->mclk = NULL;
}
/* Register CCF DAI clock control */ /* Register CCF DAI clock control */
ret = rt5682_register_dai_clks(rt5682); ret = rt5682_register_dai_clks(rt5682);
......
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