Skip to content

Commit 4907488

Browse files
YuuoniyShawn Guo
authored andcommitted
soc: imx8m: Fix incorrect check for of_clk_get_by_name()
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 <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
1 parent ae066f3 commit 4907488

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/soc/imx/soc-imx8m.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ static u32 __init imx8mq_soc_revision(void)
6666
ocotp_base = of_iomap(np, 0);
6767
WARN_ON(!ocotp_base);
6868
clk = of_clk_get_by_name(np, NULL);
69-
if (!clk) {
70-
WARN_ON(!clk);
69+
if (IS_ERR(clk)) {
70+
WARN_ON(IS_ERR(clk));
7171
return 0;
7272
}
7373

0 commit comments

Comments
 (0)