Skip to content

Commit

Permalink
soc: imx8m: Fix incorrect check for of_clk_get_by_name()
Browse files Browse the repository at this point in the history
[ Upstream commit 4907488 ]

of_clk_get_by_name() returns error pointers instead of NULL.
Use IS_ERR() checks the return value to catch errors.

Fixes: 836fb30 ("soc: imx8m: Enable OCOTP clock before reading the register")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Yuuoniy authored and gregkh committed Feb 1, 2023
1 parent c47e536 commit 9eea169
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/soc/imx/soc-imx8m.c
Expand Up @@ -66,8 +66,8 @@ static u32 __init imx8mq_soc_revision(void)
ocotp_base = of_iomap(np, 0);
WARN_ON(!ocotp_base);
clk = of_clk_get_by_name(np, NULL);
if (!clk) {
WARN_ON(!clk);
if (IS_ERR(clk)) {
WARN_ON(IS_ERR(clk));
return 0;
}

Expand Down

0 comments on commit 9eea169

Please sign in to comment.