summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>2023-05-20 16:48:19 +0200
committerMark Brown <broonie@kernel.org>2023-05-22 11:18:51 +0100
commitef44ba21995e80e19e7056593067cb4bfaad0bde (patch)
tree17a7ddd52f9411976bfc39474b7a68824be517e6 /sound
parent83b3432fc5b7128f9904a13b5d5c539c68b57447 (diff)
downloadlinux-stable-ef44ba21995e80e19e7056593067cb4bfaad0bde.tar.gz
linux-stable-ef44ba21995e80e19e7056593067cb4bfaad0bde.tar.bz2
linux-stable-ef44ba21995e80e19e7056593067cb4bfaad0bde.zip
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: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/ab0fe7e7ecf965df84b9516ba65428af9b3805c1.1684594081.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/adau17x1.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/sound/soc/codecs/adau17x1.c b/sound/soc/codecs/adau17x1.c
index 634d4dbca5ec..f2932713b4de 100644
--- a/sound/soc/codecs/adau17x1.c
+++ b/sound/soc/codecs/adau17x1.c
@@ -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;
/*