Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: max98088: Check for clk_prepare_enable() error

clk_prepare_enable() may fail, so we should better check its return
value and propagate it in the case of error.

Fixes: 62a7fc32a628 ("ASoC: max98088: Add master clock handling")
Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Link: https://patch.msgid.link/20240628080534.843815-1-nichen@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Chen Ni and committed by
Mark Brown
1a705797 061505a1

+7 -3
+7 -3
sound/soc/codecs/max98088.c
··· 1318 1318 enum snd_soc_bias_level level) 1319 1319 { 1320 1320 struct max98088_priv *max98088 = snd_soc_component_get_drvdata(component); 1321 + int ret; 1321 1322 1322 1323 switch (level) { 1323 1324 case SND_SOC_BIAS_ON: ··· 1334 1333 */ 1335 1334 if (!IS_ERR(max98088->mclk)) { 1336 1335 if (snd_soc_component_get_bias_level(component) == 1337 - SND_SOC_BIAS_ON) 1336 + SND_SOC_BIAS_ON) { 1338 1337 clk_disable_unprepare(max98088->mclk); 1339 - else 1340 - clk_prepare_enable(max98088->mclk); 1338 + } else { 1339 + ret = clk_prepare_enable(max98088->mclk); 1340 + if (ret) 1341 + return ret; 1342 + } 1341 1343 } 1342 1344 break; 1343 1345