[PATCH] clk: rockchip: Fix error pointer check after rockchip_clk_register_gate_link()

Alexander Shiyan <[email protected]>
Newsgroups org.infradead.lists.barebox
Message-ID <[email protected]>
From: Miaoqian Lin <[email protected]>

Replace NULL check with IS_ERR_OR_NULL() check after calling
rockchip_clk_register_gate_link() since this function
returns error pointers (ERR_PTR).

Fixes: c62fa612cfa6 ("clk: rockchip: implement linked gate clock support")
Signed-off-by: Miaoqian Lin <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Heiko Stuebner <[email protected]>
Signed-off-by: Alexander Shiyan <[email protected]>
---
 drivers/clk/rockchip/clk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/rockchip/clk.c b/drivers/clk/rockchip/clk.c
index 987c3bc518..d01574c60b 100644
--- a/drivers/clk/rockchip/clk.c
+++ b/drivers/clk/rockchip/clk.c
@@ -566,7 +566,7 @@ void rockchip_clk_register_late_branches(struct device *dev,
 			break;
 		}
 
-		if (!pdev)
+		if (IS_ERR_OR_NULL(pdev))
 			dev_err(dev, "failed to register device for clock %s\n", list->name);
 	}
 }
-- 
2.52.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.