* [PATCH] ASoC: codecs: wm8731: Remove unnecessary NULL check before clk_prepare_enable/clk_disable_unprepare
@ 2026-01-26 7:35 Chen Ni
2026-01-26 9:34 ` Charles Keepax
2026-01-27 12:08 ` Mark Brown
0 siblings, 2 replies; 3+ messages in thread
From: Chen Ni @ 2026-01-26 7:35 UTC (permalink / raw)
To: lgirdwood, broonie, perex, tiwai, kuninori.morimoto.gx, ckeepax
Cc: patches, linux-sound, linux-kernel, Chen Ni
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>
---
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ASoC: codecs: wm8731: Remove unnecessary NULL check before clk_prepare_enable/clk_disable_unprepare
2026-01-26 7:35 [PATCH] ASoC: codecs: wm8731: Remove unnecessary NULL check before clk_prepare_enable/clk_disable_unprepare Chen Ni
@ 2026-01-26 9:34 ` Charles Keepax
2026-01-27 12:08 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Charles Keepax @ 2026-01-26 9:34 UTC (permalink / raw)
To: Chen Ni
Cc: lgirdwood, broonie, perex, tiwai, kuninori.morimoto.gx, patches,
linux-sound, linux-kernel
On Mon, Jan 26, 2026 at 03:35:28PM +0800, Chen Ni wrote:
> 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>
Thanks,
Charles
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ASoC: codecs: wm8731: Remove unnecessary NULL check before clk_prepare_enable/clk_disable_unprepare
2026-01-26 7:35 [PATCH] ASoC: codecs: wm8731: Remove unnecessary NULL check before clk_prepare_enable/clk_disable_unprepare Chen Ni
2026-01-26 9:34 ` Charles Keepax
@ 2026-01-27 12:08 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2026-01-27 12:08 UTC (permalink / raw)
To: lgirdwood, perex, tiwai, kuninori.morimoto.gx, ckeepax, Chen Ni
Cc: patches, linux-sound, linux-kernel
On Mon, 26 Jan 2026 15:35:28 +0800, Chen Ni wrote:
> clk_prepare_enable() and clk_disable_unprepare() already checked NULL
> clock parameter.
> Remove unneeded NULL check for wm8731->mclk here.
>
>
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/1] ASoC: codecs: wm8731: Remove unnecessary NULL check before clk_prepare_enable/clk_disable_unprepare
commit: 87ee3f05bfe2f5955c2c77ae26a1be236fd615a5
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-01-27 12:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-26 7:35 [PATCH] ASoC: codecs: wm8731: Remove unnecessary NULL check before clk_prepare_enable/clk_disable_unprepare Chen Ni
2026-01-26 9:34 ` Charles Keepax
2026-01-27 12:08 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox