Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: imx-audmux: remove unnecessary check of clk_disable_unprepare/clk_prepare_enable

Because clk_disable_unprepare/clk_prepare_enable already checked NULL clock
parameter, so the additional checks are unnecessary, just remove them.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Link: https://lore.kernel.org/r/20220606033705.291048-1-chi.minghao@zte.com.cn
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Minghao Chi and committed by
Mark Brown
142d4562 d3d8fead

+8 -14
+8 -14
sound/soc/fsl/imx-audmux.c
··· 62 62 uintptr_t port = (uintptr_t)file->private_data; 63 63 u32 pdcr, ptcr; 64 64 65 - if (audmux_clk) { 66 - ret = clk_prepare_enable(audmux_clk); 67 - if (ret) 68 - return ret; 69 - } 65 + ret = clk_prepare_enable(audmux_clk); 66 + if (ret) 67 + return ret; 70 68 71 69 ptcr = readl(audmux_base + IMX_AUDMUX_V2_PTCR(port)); 72 70 pdcr = readl(audmux_base + IMX_AUDMUX_V2_PDCR(port)); 73 71 74 - if (audmux_clk) 75 - clk_disable_unprepare(audmux_clk); 72 + clk_disable_unprepare(audmux_clk); 76 73 77 74 buf = kmalloc(PAGE_SIZE, GFP_KERNEL); 78 75 if (!buf) ··· 206 209 if (!audmux_base) 207 210 return -ENOSYS; 208 211 209 - if (audmux_clk) { 210 - ret = clk_prepare_enable(audmux_clk); 211 - if (ret) 212 - return ret; 213 - } 212 + ret = clk_prepare_enable(audmux_clk); 213 + if (ret) 214 + return ret; 214 215 215 216 writel(ptcr, audmux_base + IMX_AUDMUX_V2_PTCR(port)); 216 217 writel(pdcr, audmux_base + IMX_AUDMUX_V2_PDCR(port)); 217 218 218 - if (audmux_clk) 219 - clk_disable_unprepare(audmux_clk); 219 + clk_disable_unprepare(audmux_clk); 220 220 221 221 return 0; 222 222 }