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: codecs: wm8731: Remove unnecessary NULL check before clk_prepare_enable/clk_disable_unprepare

clk_prepare_enable() and clk_disable_unprepare() already checked NULL
clock parameter.
Remove unneeded NULL check for wm8731->mclk here.

Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20260126073528.1826406-1-nichen@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Chen Ni and committed by
Mark Brown
87ee3f05 f80bee70

+4 -7
+4 -7
sound/soc/codecs/wm8731.c
··· 471 471 472 472 switch (level) { 473 473 case SND_SOC_BIAS_ON: 474 - if (wm8731->mclk) { 475 - ret = clk_prepare_enable(wm8731->mclk); 476 - if (ret) 477 - return ret; 478 - } 474 + ret = clk_prepare_enable(wm8731->mclk); 475 + if (ret) 476 + return ret; 479 477 break; 480 478 case SND_SOC_BIAS_PREPARE: 481 479 break; ··· 492 494 snd_soc_component_write(component, WM8731_PWR, reg | 0x0040); 493 495 break; 494 496 case SND_SOC_BIAS_OFF: 495 - if (wm8731->mclk) 496 - clk_disable_unprepare(wm8731->mclk); 497 + clk_disable_unprepare(wm8731->mclk); 497 498 snd_soc_component_write(component, WM8731_PWR, 0xffff); 498 499 regulator_bulk_disable(ARRAY_SIZE(wm8731->supplies), 499 500 wm8731->supplies);