linux-clk.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] clk:clk-imx8-acm:fix wrong pointer check in clk_imx_acm_attach_pm_domains()
@ 2024-08-20  2:59 Yuesong Li
  2024-08-20 22:07 ` Stephen Boyd
  0 siblings, 1 reply; 2+ messages in thread
From: Yuesong Li @ 2024-08-20  2:59 UTC (permalink / raw)
  To: abelvesa, mturquette, shawnguo, s.hauer, sboyd
  Cc: peng.fan, kernel, festevam, shengjiu.wang, linux-clk, imx,
	linux-arm-kernel, linux-kernel, opensource.kernel, Yuesong Li

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(-)

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;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v1] clk:clk-imx8-acm:fix wrong pointer check in clk_imx_acm_attach_pm_domains()
  2024-08-20  2:59 [PATCH v1] clk:clk-imx8-acm:fix wrong pointer check in clk_imx_acm_attach_pm_domains() Yuesong Li
@ 2024-08-20 22:07 ` Stephen Boyd
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Boyd @ 2024-08-20 22:07 UTC (permalink / raw)
  To: Yuesong Li, abelvesa, mturquette, s.hauer, shawnguo
  Cc: peng.fan, kernel, festevam, shengjiu.wang, linux-clk, imx,
	linux-arm-kernel, linux-kernel, opensource.kernel, Yuesong Li

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?

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-08-20 22:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-20  2:59 [PATCH v1] clk:clk-imx8-acm:fix wrong pointer check in clk_imx_acm_attach_pm_domains() Yuesong Li
2024-08-20 22:07 ` Stephen Boyd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).