summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/cs53l30.c
diff options
context:
space:
mode:
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>2023-05-20 17:54:06 +0300
committerMark Brown <broonie@kernel.org>2023-05-22 13:18:56 +0300
commit0b855cbbd769940fcaf49b2371a05235d8499d5d (patch)
tree1ce087cdbce83ca841692e886269fa642817d2c4 /sound/soc/codecs/cs53l30.c
parent374628fb668e50b42fe81f2a63af616182415bcd (diff)
downloadlinux-0b855cbbd769940fcaf49b2371a05235d8499d5d.tar.xz
ASoC: cs53l30: 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/3219effee5c7f190530bdb1ef8ec35cb142e3611.1684594433.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/cs53l30.c')
-rw-r--r--sound/soc/codecs/cs53l30.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/sound/soc/codecs/cs53l30.c b/sound/soc/codecs/cs53l30.c
index 51ca66e7b3ea..21962b828ab1 100644
--- a/sound/soc/codecs/cs53l30.c
+++ b/sound/soc/codecs/cs53l30.c
@@ -990,14 +990,10 @@ static int cs53l30_i2c_probe(struct i2c_client *client)
}
/* Check if MCLK provided */
- cs53l30->mclk = devm_clk_get(dev, "mclk");
+ cs53l30->mclk = devm_clk_get_optional(dev, "mclk");
if (IS_ERR(cs53l30->mclk)) {
- if (PTR_ERR(cs53l30->mclk) != -ENOENT) {
- ret = PTR_ERR(cs53l30->mclk);
- goto error;
- }
- /* Otherwise mark the mclk pointer to NULL */
- cs53l30->mclk = NULL;
+ ret = PTR_ERR(cs53l30->mclk);
+ goto error;
}
/* Fetch the MUTE control */