[PATCH -next] clk: imx: remove unnecessary NULL check of clk

From: Yang Yingliang
Date: Thu Jun 30 2022 - 10:19:32 EST


It has NULL check in clk_prepare_enable(), so it no need
to check the clk before calling it.

Signed-off-by: Yang Yingliang <yangyingliang@xxxxxxxxxx>
---
drivers/clk/imx/clk.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/clk/imx/clk.c b/drivers/clk/imx/clk.c
index 5582f18dd632..1c5d5b957c96 100644
--- a/drivers/clk/imx/clk.c
+++ b/drivers/clk/imx/clk.c
@@ -189,9 +189,7 @@ void imx_register_uart_clocks(unsigned int clk_count)
if (IS_ERR(imx_uart_clocks[imx_enabled_uart_clocks]))
return;

- /* Only enable the clock if it's not NULL */
- if (imx_uart_clocks[imx_enabled_uart_clocks])
- clk_prepare_enable(imx_uart_clocks[imx_enabled_uart_clocks++]);
+ clk_prepare_enable(imx_uart_clocks[imx_enabled_uart_clocks++]);
}
}
#endif
--
2.25.1