Commit ef44ba21 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Mark Brown

ASoC: adau1761: 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/ab0fe7e7ecf965df84b9516ba65428af9b3805c1.1684594081.git.christophe.jaillet@wanadoo.frSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 83b3432f
......@@ -1059,13 +1059,12 @@ int adau17x1_probe(struct device *dev, struct regmap *regmap,
if (!adau)
return -ENOMEM;
adau->mclk = devm_clk_get(dev, "mclk");
if (IS_ERR(adau->mclk)) {
if (PTR_ERR(adau->mclk) != -ENOENT)
return PTR_ERR(adau->mclk);
/* Clock is optional (for the driver) */
adau->mclk = NULL;
} else if (adau->mclk) {
/* Clock is optional (for the driver) */
adau->mclk = devm_clk_get_optional(dev, "mclk");
if (IS_ERR(adau->mclk))
return PTR_ERR(adau->mclk);
if (adau->mclk) {
adau->clk_src = ADAU17X1_CLK_SRC_PLL_AUTO;
/*
......
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