From 58e7bca5cf264e910ad9199cfc40246e0a2834f4 Mon Sep 17 00:00:00 2001 From: Karl Mehltretter Date: Sat, 3 Oct 2026 21:07:38 +0200 Subject: [PATCH] ASoC: codecs: es8375: use devm_clk_get_optional() for mclk es8375_read_device_properities() gets "mclk" with devm_clk_get() and then tests the result for NULL to print "assuming static mclk". A missing clock makes devm_clk_get() return -ENOENT, so the probe fails before that test can match. The binding does not require clocks, its example has none, and everest,mclk-src lets the codec run from SCLK instead of MCLK. Use devm_clk_get_optional(), as es8311, es8316, es8323, es8326 and es8389 do for the same clock. Found with an experimental clang warning about NULL tests on functions that return error pointers. Tested only in QEMU with i2c-stub in place of the codec, not on real hardware. Fixes: de2b3119f9f7 ("ASoC: codecs: add support for ES8375") Assisted-by: LLM Signed-off-by: Karl Mehltretter Link: https://patch.msgid.link/20261003190738.77564-1-kmehltretter@gmail.com Signed-off-by: Mark Brown --- sound/soc/codecs/es8375.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/es8375.c b/sound/soc/codecs/es8375.c index 80707d2768c6..bed872eafc95 100644 --- a/sound/soc/codecs/es8375.c +++ b/sound/soc/codecs/es8375.c @@ -677,7 +677,7 @@ static int es8375_read_device_properities(struct device *dev, struct es8375_priv return ret; } - es8375->mclk = devm_clk_get(dev, "mclk"); + es8375->mclk = devm_clk_get_optional(dev, "mclk"); if (IS_ERR(es8375->mclk)) return dev_err_probe(dev, PTR_ERR(es8375->mclk), "unable to get mclk\n");