Skip to contentSkip to conversation

ASoC: codecs: es8375: use devm_clk_get_optional() for mclk

PATCH In review Karl Mehltretter 2 participants 2 messages Oct 3 – Oct 5

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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
---
 sound/soc/codecs/es8375.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/es8375.c +1 -1
index e8747bc24433..67bf73d80fb5 100644
@@ -661,7 +661,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");
 

base-commit: e767a4ea70a3992c37ed604157d32f0dfbf9b1e3

Signature · 1 line
2.53.0
maintainer
#1 lore raw
Quoted 1 line · Karl Mehltretter

ASoC: codecs: es8375: use devm_clk_get_optional() for mclk

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.4

Thanks!

[1/1] ASoC: codecs: es8375: use devm_clk_get_optional() for mclk

      https://git.kernel.org/broonie/sound/c/58e7bca5cf26

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark