<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jun 6, 2022 at 11:37 AM <<a href="mailto:cgel.zte@gmail.com">cgel.zte@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">From: Minghao Chi <<a href="mailto:chi.minghao@zte.com.cn" target="_blank">chi.minghao@zte.com.cn</a>><br>
<br>
Because clk_disable_unprepare/clk_prepare_enable already checked NULL clock<br>
parameter, so the additional checks are unnecessary, just remove them.<br>
<br>
Reported-by: Zeal Robot <<a href="mailto:zealci@zte.com.cn" target="_blank">zealci@zte.com.cn</a>><br>
Signed-off-by: Minghao Chi <<a href="mailto:chi.minghao@zte.com.cn" target="_blank">chi.minghao@zte.com.cn</a>><br></blockquote><div><br></div><div>Acked-by: Shengjiu Wang <<a href="mailto:shengjiu.wang@gmail.com">shengjiu.wang@gmail.com</a>></div><div><br></div><div>Best regards</div><div>Wang Shengjiu </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
---<br>
v1->v2:<br>
remove the check of audmux_clk before "clk_prepare_enable"<br>
sound/soc/fsl/imx-audmux.c | 22 ++++++++--------------<br>
1 file changed, 8 insertions(+), 14 deletions(-)<br>
<br>
diff --git a/sound/soc/fsl/imx-audmux.c b/sound/soc/fsl/imx-audmux.c<br>
index dfa05d40b276..3ba82adace42 100644<br>
--- a/sound/soc/fsl/imx-audmux.c<br>
+++ b/sound/soc/fsl/imx-audmux.c<br>
@@ -62,17 +62,14 @@ static ssize_t audmux_read_file(struct file *file, char __user *user_buf,<br>
uintptr_t port = (uintptr_t)file->private_data;<br>
u32 pdcr, ptcr;<br>
<br>
- if (audmux_clk) {<br>
- ret = clk_prepare_enable(audmux_clk);<br>
- if (ret)<br>
- return ret;<br>
- }<br>
+ ret = clk_prepare_enable(audmux_clk);<br>
+ if (ret)<br>
+ return ret;<br>
<br>
ptcr = readl(audmux_base + IMX_AUDMUX_V2_PTCR(port));<br>
pdcr = readl(audmux_base + IMX_AUDMUX_V2_PDCR(port));<br>
<br>
- if (audmux_clk)<br>
- clk_disable_unprepare(audmux_clk);<br>
+ clk_disable_unprepare(audmux_clk);<br>
<br>
buf = kmalloc(PAGE_SIZE, GFP_KERNEL);<br>
if (!buf)<br>
@@ -209,17 +206,14 @@ int imx_audmux_v2_configure_port(unsigned int port, unsigned int ptcr,<br>
if (!audmux_base)<br>
return -ENOSYS;<br>
<br>
- if (audmux_clk) {<br>
- ret = clk_prepare_enable(audmux_clk);<br>
- if (ret)<br>
- return ret;<br>
- }<br>
+ ret = clk_prepare_enable(audmux_clk);<br>
+ if (ret)<br>
+ return ret;<br>
<br>
writel(ptcr, audmux_base + IMX_AUDMUX_V2_PTCR(port));<br>
writel(pdcr, audmux_base + IMX_AUDMUX_V2_PDCR(port));<br>
<br>
- if (audmux_clk)<br>
- clk_disable_unprepare(audmux_clk);<br>
+ clk_disable_unprepare(audmux_clk);<br>
<br>
return 0;<br>
}<br>
-- <br>
2.25.1<br>
<br>
<br>
</blockquote></div></div>