[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20260126073528.1826406-1-nichen@iscas.ac.cn>
Date: Mon, 26 Jan 2026 15:35:28 +0800
From: Chen Ni <nichen@...as.ac.cn>
To: lgirdwood@...il.com,
broonie@...nel.org,
perex@...ex.cz,
tiwai@...e.com,
kuninori.morimoto.gx@...esas.com,
ckeepax@...nsource.cirrus.com
Cc: patches@...nsource.cirrus.com,
linux-sound@...r.kernel.org,
linux-kernel@...r.kernel.org,
Chen Ni <nichen@...as.ac.cn>
Subject: [PATCH] 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@...as.ac.cn>
---
sound/soc/codecs/wm8731.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c
index a03bbde5d852..a2f0e2f5c407 100644
--- a/sound/soc/codecs/wm8731.c
+++ b/sound/soc/codecs/wm8731.c
@@ -471,11 +471,9 @@ static int wm8731_set_bias_level(struct snd_soc_component *component,
switch (level) {
case SND_SOC_BIAS_ON:
- if (wm8731->mclk) {
- ret = clk_prepare_enable(wm8731->mclk);
- if (ret)
- return ret;
- }
+ ret = clk_prepare_enable(wm8731->mclk);
+ if (ret)
+ return ret;
break;
case SND_SOC_BIAS_PREPARE:
break;
@@ -494,8 +492,7 @@ static int wm8731_set_bias_level(struct snd_soc_component *component,
snd_soc_component_write(component, WM8731_PWR, reg | 0x0040);
break;
case SND_SOC_BIAS_OFF:
- if (wm8731->mclk)
- clk_disable_unprepare(wm8731->mclk);
+ clk_disable_unprepare(wm8731->mclk);
snd_soc_component_write(component, WM8731_PWR, 0xffff);
regulator_bulk_disable(ARRAY_SIZE(wm8731->supplies),
wm8731->supplies);
--
2.25.1
Powered by blists - more mailing lists