mirror of
https://github.com/torvalds/linux.git
synced 2026-11-10 17:11:02 +01:00
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: de2b3119f9 ("ASoC: codecs: add support for ES8375")
Assisted-by: LLM
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Link: https://patch.msgid.link/20261003190738.77564-1-kmehltretter@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
9a773d9d21
commit
58e7bca5cf
|
|
@ -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");
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user