diff mbox series

[v1] clk:clk-imx8-acm:fix wrong pointer check in clk_imx_acm_attach_pm_domains()

Message ID 20240820025902.2355565-1-liyuesong@vivo.com (mailing list archive)
State New
Headers show
Series [v1] clk:clk-imx8-acm:fix wrong pointer check in clk_imx_acm_attach_pm_domains() | expand

Commit Message

Yuesong Li Aug. 20, 2024, 2:59 a.m. UTC
device_link_add() returns NULL pointer not PTR_ERR() when it fails,so
replace the IS_ERR() check with NULL pointer check.

Fixes: d3a0946d7ac9 ("clk: imx: imx8: add audio clock mux driver")
Signed-off-by: Yuesong Li <liyuesong@vivo.com>
---
 drivers/clk/imx/clk-imx8-acm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stephen Boyd Aug. 20, 2024, 10:07 p.m. UTC | #1
Quoting Yuesong Li (2024-08-19 19:59:02)
> device_link_add() returns NULL pointer not PTR_ERR() when it fails,so
> replace the IS_ERR() check with NULL pointer check.

Can you document that fact by adding a "Return:" line to the kernel-doc
for device_link_add() in another patch?
diff mbox series

Patch

diff --git a/drivers/clk/imx/clk-imx8-acm.c b/drivers/clk/imx/clk-imx8-acm.c
index 1bdb480cc96c..ed8cad8d6a57 100644
--- a/drivers/clk/imx/clk-imx8-acm.c
+++ b/drivers/clk/imx/clk-imx8-acm.c
@@ -289,7 +289,7 @@  static int clk_imx_acm_attach_pm_domains(struct device *dev,
 							 DL_FLAG_STATELESS |
 							 DL_FLAG_PM_RUNTIME |
 							 DL_FLAG_RPM_ACTIVE);
-		if (IS_ERR(dev_pm->pd_dev_link[i])) {
+		if (!dev_pm->pd_dev_link[i]) {
 			dev_pm_domain_detach(dev_pm->pd_dev[i], false);
 			ret = PTR_ERR(dev_pm->pd_dev_link[i]);
 			goto detach_pm;