ASoC: sta32x: Remove unnecessary NULL check before clk_disable_unprepare()
authorChen Ni <nichen@iscas.ac.cn>
Tue, 25 Mar 2025 03:22:26 +0000 (11:22 +0800)
committerMark Brown <broonie@kernel.org>
Sun, 6 Apr 2025 22:25:20 +0000 (23:25 +0100)
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>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://patch.msgid.link/20250325032226.603963-1-nichen@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/sta32x.c

index bd8848ea1ec2f23afdc608141148161882086293..24d4b643917da1d9348b49769a7614faad5f527e 100644 (file)
@@ -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 = {