[PATCH] ASoC: sta32x: Remove unnecessary NULL check before clk_disable_unprepare()

Chen Ni posted 1 patch 8 months, 3 weeks ago
sound/soc/codecs/sta32x.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
[PATCH] ASoC: sta32x: Remove unnecessary NULL check before clk_disable_unprepare()
Posted by Chen Ni 8 months, 3 weeks ago
clk_disable_unprepare() already checks NULL by using IS_ERR_OR_NULL.
Remove unneeded NULL check for clk here.

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

diff --git a/sound/soc/codecs/sta32x.c b/sound/soc/codecs/sta32x.c
index bd8848ea1ec2..24d4b643917d 100644
--- a/sound/soc/codecs/sta32x.c
+++ b/sound/soc/codecs/sta32x.c
@@ -983,8 +983,7 @@ static int sta32x_probe(struct snd_soc_component *component)
 err_regulator_bulk_disable:
 	regulator_bulk_disable(ARRAY_SIZE(sta32x->supplies), sta32x->supplies);
 err_clk_disable_unprepare:
-	if (sta32x->xti_clk)
-		clk_disable_unprepare(sta32x->xti_clk);
+	clk_disable_unprepare(sta32x->xti_clk);
 	return ret;
 }
 
@@ -995,8 +994,7 @@ static void sta32x_remove(struct snd_soc_component *component)
 	sta32x_watchdog_stop(sta32x);
 	regulator_bulk_disable(ARRAY_SIZE(sta32x->supplies), sta32x->supplies);
 
-	if (sta32x->xti_clk)
-		clk_disable_unprepare(sta32x->xti_clk);
+	clk_disable_unprepare(sta32x->xti_clk);
 }
 
 static const struct snd_soc_component_driver sta32x_component = {
-- 
2.25.1
Re: [PATCH] ASoC: sta32x: Remove unnecessary NULL check before clk_disable_unprepare()
Posted by Mark Brown 8 months, 1 week ago
On Tue, 25 Mar 2025 11:22:26 +0800, Chen Ni wrote:
> clk_disable_unprepare() already checks NULL by using IS_ERR_OR_NULL.
> Remove unneeded NULL check for clk here.
> 
> 

Applied to

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

Thanks!

[1/1] ASoC: sta32x: Remove unnecessary NULL check before clk_disable_unprepare()
      commit: ea61f39b38bdbb7c77ba2c70e130acdb808c8d68

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
Re: [PATCH] ASoC: sta32x: Remove unnecessary NULL check before clk_disable_unprepare()
Posted by Andy Shevchenko 8 months, 3 weeks ago
On Tue, Mar 25, 2025 at 5:23 AM Chen Ni <nichen@iscas.ac.cn> wrote:
>
> clk_disable_unprepare() already checks NULL by using IS_ERR_OR_NULL.

IS_ERR_OR_NULL()

> Remove unneeded NULL check for clk here.

Reviewed-by: Andy Shevchenko <andy@kernel.org>

-- 
With Best Regards,
Andy Shevchenko