[PATCH] ASoC: ti: davinci-i2s: remove unnecessary NULL check before clk_disable_unprepare()

Chen Ni posted 1 patch 9 months, 1 week ago
sound/soc/ti/davinci-i2s.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
[PATCH] ASoC: ti: davinci-i2s: remove unnecessary NULL check before clk_disable_unprepare()
Posted by Chen Ni 9 months, 1 week ago
clk_disable_unprepare() already checks NULL by using IS_ERR_OR_NULL.
Remove unneeded NULL check for dev->ext_clk here.

Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
---
 sound/soc/ti/davinci-i2s.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/sound/soc/ti/davinci-i2s.c b/sound/soc/ti/davinci-i2s.c
index d682b98d6848..059967f0e632 100644
--- a/sound/soc/ti/davinci-i2s.c
+++ b/sound/soc/ti/davinci-i2s.c
@@ -892,8 +892,7 @@ static int davinci_i2s_probe(struct platform_device *pdev)
 err_unregister_component:
 	snd_soc_unregister_component(&pdev->dev);
 err_disable_ext_clk:
-	if (dev->ext_clk)
-		clk_disable_unprepare(dev->ext_clk);
+	clk_disable_unprepare(dev->ext_clk);
 err_disable_clk:
 	clk_disable_unprepare(dev->clk);
 
@@ -908,8 +907,7 @@ static void davinci_i2s_remove(struct platform_device *pdev)
 
 	clk_disable_unprepare(dev->clk);
 
-	if (dev->ext_clk)
-		clk_disable_unprepare(dev->ext_clk);
+	clk_disable_unprepare(dev->ext_clk);
 }
 
 static const struct of_device_id davinci_i2s_match[] __maybe_unused = {
-- 
2.25.1
Re: [PATCH] ASoC: ti: davinci-i2s: remove unnecessary NULL check before clk_disable_unprepare()
Posted by Mark Brown 9 months, 1 week ago
On Wed, 12 Mar 2025 11:35:09 +0800, Chen Ni wrote:
> clk_disable_unprepare() already checks NULL by using IS_ERR_OR_NULL.
> Remove unneeded NULL check for dev->ext_clk here.
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: ti: davinci-i2s: remove unnecessary NULL check before clk_disable_unprepare()
      commit: 1458fae110c85d98d356496e4eb120f6de0e3a7e

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