Unverified Commit 142d4562 authored by Minghao Chi's avatar Minghao Chi Committed by Mark Brown
Browse files

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: default avatarZeal Robot <zealci@zte.com.cn>
Signed-off-by: default avatarMinghao Chi <chi.minghao@zte.com.cn>
Acked-by: default avatarShengjiu Wang <shengjiu.wang@gmail.com>
Link: https://lore.kernel.org/r/20220606033705.291048-1-chi.minghao@zte.com.cn


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent d3d8fead
Loading
Loading
Loading
Loading
+8 −14
Original line number Diff line number Diff line
@@ -62,16 +62,13 @@ static ssize_t audmux_read_file(struct file *file, char __user *user_buf,
	uintptr_t port = (uintptr_t)file->private_data;
	u32 pdcr, ptcr;

	if (audmux_clk) {
	ret = clk_prepare_enable(audmux_clk);
	if (ret)
		return ret;
	}

	ptcr = readl(audmux_base + IMX_AUDMUX_V2_PTCR(port));
	pdcr = readl(audmux_base + IMX_AUDMUX_V2_PDCR(port));

	if (audmux_clk)
	clk_disable_unprepare(audmux_clk);

	buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
@@ -209,16 +206,13 @@ int imx_audmux_v2_configure_port(unsigned int port, unsigned int ptcr,
	if (!audmux_base)
		return -ENOSYS;

	if (audmux_clk) {
	ret = clk_prepare_enable(audmux_clk);
	if (ret)
		return ret;
	}

	writel(ptcr, audmux_base + IMX_AUDMUX_V2_PTCR(port));
	writel(pdcr, audmux_base + IMX_AUDMUX_V2_PDCR(port));

	if (audmux_clk)
	clk_disable_unprepare(audmux_clk);

	return 0;